forked from nodejs/node
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test_runner: pass FORCE_COLOR to child process
PR-URL: nodejs#48057 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
- Loading branch information
Showing
7 changed files
with
65 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
test/fixtures/test-runner/output/arbitrary-output-colored-1.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
'use strict'; | ||
|
||
const test = require('node:test'); | ||
console.log({ foo: 'bar' }); | ||
test('passing test', () => { | ||
console.log(1); | ||
}); |
11 changes: 11 additions & 0 deletions
11
test/fixtures/test-runner/output/arbitrary-output-colored.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
'use strict'; | ||
const common = require('../../../common'); | ||
const { once } = require('node:events'); | ||
const { spawn } = require('node:child_process'); | ||
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'); | ||
})().then(common.mustCall()); |
28 changes: 28 additions & 0 deletions
28
test/fixtures/test-runner/output/arbitrary-output-colored.snapshot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ foo: [32m'bar'[39m } | ||
[33m1[39m | ||
[32m✔ passing test [90m(*ms)[39m[39m | ||
[34mℹ tests 1[39m | ||
[34mℹ suites 0[39m | ||
[34mℹ pass 1[39m | ||
[34mℹ fail 0[39m | ||
[34mℹ cancelled 0[39m | ||
[34mℹ skipped 0[39m | ||
[34mℹ todo 0[39m | ||
[34mℹ duration_ms *[39m | ||
TAP version 13 | ||
# { foo: [32m'bar'[39m } | ||
# [33m1[39m | ||
# Subtest: passing test | ||
ok 1 - passing test | ||
--- | ||
duration_ms: * | ||
... | ||
1..1 | ||
# tests 1 | ||
# suites 0 | ||
# pass 1 | ||
# fail 0 | ||
# cancelled 0 | ||
# skipped 0 | ||
# todo 0 | ||
# duration_ms * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters