Skip to content

Commit

Permalink
[jest-runner] Don't print warning to stdout when using --json
Browse files Browse the repository at this point in the history
  • Loading branch information
cpojer committed Apr 19, 2020
1 parent 3681cca commit 70b2fcc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -13,6 +13,7 @@
- `[jest-circus]` Throw on nested test definitions ([#9828](https://github.com/facebook/jest/pull/9828))
- `[jest-changed-files]` `--only-changed` should include staged files ([#9799](https://github.com/facebook/jest/pull/9799))
- `[jest-each]` `each` will throw an error when called with too many arguments ([#9818](https://github.com/facebook/jest/pull/9818))
- `[jest-runner]` Don't print warning to stdout when using `--json` ([#9843](https://github.com/facebook/jest/pull/9843))

### Chore & Maintenance

Expand Down
4 changes: 2 additions & 2 deletions e2e/__tests__/workerForceExit.test.ts
Expand Up @@ -42,11 +42,11 @@ test('prints a warning if a worker is force exited', () => {
});
`,
});
const {exitCode, stderr, stdout} = runJest(DIR, ['--maxWorkers=2']);
const {exitCode, stderr} = runJest(DIR, ['--maxWorkers=2']);

expect(exitCode).toBe(0);
verifyNumPassed(stderr);
expect(stdout).toContain('A worker process has failed to exit gracefully');
expect(stderr).toContain('A worker process has failed to exit gracefully');
});

test('force exits a worker that fails to exit gracefully', async () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-runner/src/index.ts
Expand Up @@ -194,7 +194,7 @@ class TestRunner {
const cleanup = async () => {
const {forceExited} = await worker.end();
if (forceExited) {
console.log(
console.error(
chalk.yellow(
'A worker process has failed to exit gracefully and has been force exited. ' +
'This is likely caused by tests leaking due to improper teardown. ' +
Expand Down

0 comments on commit 70b2fcc

Please sign in to comment.