Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[jest-runner] Don't print warning to stdout when using --json #9843

Merged
merged 1 commit into from Apr 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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