Skip to content

Commit ed4cadb

Browse files
authored
[jest-runner] Don't print warning to stdout when using `--json (#9843)
1 parent 75ab1ab commit ed4cadb

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
- `[jest-circus]` Throw on nested test definitions ([#9828](https://github.com/facebook/jest/pull/9828))
1313
- `[jest-changed-files]` `--only-changed` should include staged files ([#9799](https://github.com/facebook/jest/pull/9799))
1414
- `[jest-each]` `each` will throw an error when called with too many arguments ([#9818](https://github.com/facebook/jest/pull/9818))
15+
- `[jest-runner]` Don't print warning to stdout when using `--json` ([#9843](https://github.com/facebook/jest/pull/9843))
1516

1617
### Chore & Maintenance
1718

e2e/__tests__/workerForceExit.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ test('prints a warning if a worker is force exited', () => {
4242
});
4343
`,
4444
});
45-
const {exitCode, stderr, stdout} = runJest(DIR, ['--maxWorkers=2']);
45+
const {exitCode, stderr} = runJest(DIR, ['--maxWorkers=2']);
4646

4747
expect(exitCode).toBe(0);
4848
verifyNumPassed(stderr);
49-
expect(stdout).toContain('A worker process has failed to exit gracefully');
49+
expect(stderr).toContain('A worker process has failed to exit gracefully');
5050
});
5151

5252
test('force exits a worker that fails to exit gracefully', async () => {

packages/jest-runner/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ class TestRunner {
194194
const cleanup = async () => {
195195
const {forceExited} = await worker.end();
196196
if (forceExited) {
197-
console.log(
197+
console.error(
198198
chalk.yellow(
199199
'A worker process has failed to exit gracefully and has been force exited. ' +
200200
'This is likely caused by tests leaking due to improper teardown. ' +

0 commit comments

Comments
 (0)