Skip to content

Commit

Permalink
test: fix test runner colored output test
Browse files Browse the repository at this point in the history
  • Loading branch information
MoLow committed Dec 7, 2023
1 parent 42b238e commit 764ba19
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/fixtures/test-runner/output/arbitrary-output-colored.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const fixtures = require('../../../common/fixtures');

(async function run() {
const test = fixtures.path('test-runner/output/arbitrary-output-colored-1.js');
await once(spawn(process.execPath, ['--test', test], { stdio: 'inherit', env: { FORCE_COLOR: 1 } }), 'exit');
await once(spawn(process.execPath, ['--test', '--test-reporter', 'tap', test], { stdio: 'inherit', env: { FORCE_COLOR: 1 } }), 'exit');
const reset = fixtures.path('test-runner/output/reset-color-depth.js');
await once(spawn(process.execPath, ['-r', reset, '--test', test], { stdio: 'inherit' }), 'exit');
await once(spawn(process.execPath, ['-r', reset, '--test', '--test-reporter', 'tap', test], { stdio: 'inherit' }), 'exit');
})().then(common.mustCall());
5 changes: 5 additions & 0 deletions test/fixtures/test-runner/output/reset-color-depth.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
'use strict';

// Make tests OS-independent by overriding stdio getColorDepth().
process.stdout.getColorDepth = () => 8;
process.stderr.getColorDepth = () => 8;

0 comments on commit 764ba19

Please sign in to comment.