Skip to content

Commit

Permalink
fix: strip ANSI from new test output
Browse files Browse the repository at this point in the history
- Before checking for substrings in stdout, strip ANSI escape codes
  • Loading branch information
mdmower-csnw committed Jul 31, 2024
1 parent 4c2a342 commit 8c2836f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/specs/watch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -348,9 +348,10 @@ export default testSuite(async ({ describe }, { tsx }: NodeApis) => {
});

const tsxProcessResolved = await tsxProcess;
expect(tsxProcessResolved.stdout).toContain(`change in ./${fileA}`);
expect(tsxProcessResolved.stdout).toContain(`change in ./${fileB}`);
expect(tsxProcessResolved.stdout).toContain(`change in ./${entryFile}`);
const stdout = stripAnsi(tsxProcessResolved.stdout);
expect(stdout).toContain(`change in ./${fileA}`);
expect(stdout).toContain(`change in ./${fileB}`);
expect(stdout).toContain(`change in ./${entryFile}`);
expect(tsxProcessResolved.stderr).toBe('');
}, 10_000);
});
Expand Down

0 comments on commit 8c2836f

Please sign in to comment.