Skip to content

Commit 764ba19

Browse files
committed
test: fix test runner colored output test
1 parent 42b238e commit 764ba19

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

test/fixtures/test-runner/output/arbitrary-output-colored.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ const fixtures = require('../../../common/fixtures');
66

77
(async function run() {
88
const test = fixtures.path('test-runner/output/arbitrary-output-colored-1.js');
9-
await once(spawn(process.execPath, ['--test', test], { stdio: 'inherit', env: { FORCE_COLOR: 1 } }), 'exit');
10-
await once(spawn(process.execPath, ['--test', '--test-reporter', 'tap', test], { stdio: 'inherit', env: { FORCE_COLOR: 1 } }), 'exit');
9+
const reset = fixtures.path('test-runner/output/reset-color-depth.js');
10+
await once(spawn(process.execPath, ['-r', reset, '--test', test], { stdio: 'inherit' }), 'exit');
11+
await once(spawn(process.execPath, ['-r', reset, '--test', '--test-reporter', 'tap', test], { stdio: 'inherit' }), 'exit');
1112
})().then(common.mustCall());
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
'use strict';
2+
3+
// Make tests OS-independent by overriding stdio getColorDepth().
4+
process.stdout.getColorDepth = () => 8;
5+
process.stderr.getColorDepth = () => 8;

0 commit comments

Comments
 (0)