Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
### Features

- `[jest-config]` [**BREAKING**] Default to Node testing environment instead of browser (JSDOM) ([#9874](https://github.com/facebook/jest/pull/9874))
- `[jest-runner]` [**BREAKING**] set exit code to 1 if test logs after teardown ([#10728](https://github.com/facebook/jest/pull/10728))

### Fixes

Expand Down
2 changes: 1 addition & 1 deletion e2e/__tests__/consoleAfterTeardown.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ test('console printing', () => {
const {stderr, exitCode} = runJest('console-after-teardown');
const {rest} = extractSummary(stderr);

expect(exitCode).toBe(0);
expect(exitCode).toBe(1);

const withoutTrace = rest.split('\n').slice(0, -3).join('\n');

Expand Down
3 changes: 1 addition & 2 deletions packages/jest-runner/src/runTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ function freezeConsole(
);

process.stderr.write('\n' + formattedError + '\n');
// TODO: set exit code in Jest 25
// process.exitCode = 1;
process.exitCode = 1;
};
}

Expand Down