Skip to content

Commit

Permalink
test: ignore colors in test-runner-run when not a TTY
Browse files Browse the repository at this point in the history
  • Loading branch information
puskin94 committed Aug 27, 2024
1 parent 1399d4e commit 79e477d
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions test/parallel/test-runner-run.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,18 @@ describe('require(\'node:test\').run', { concurrency: true }, () => {
const result = await run({
files: [join(testFixtures, 'default-behavior/test/random.cjs')]
}).compose(dot).toArray();
assert.deepStrictEqual(result, [
'.',
'\n',
]);

if (process.stderr.isTTY) {
assert.deepStrictEqual(result, [
'\x1B[32m.\x1Bc',
'\n',
]);
} else {
assert.deepStrictEqual(result, [
'.',
'\n',
]);
}
});

describe('should be piped with spec reporter', () => {
Expand Down

0 comments on commit 79e477d

Please sign in to comment.