Skip to content

Commit

Permalink
set exitcode to 1 if tests log after teardown
Browse files Browse the repository at this point in the history
  • Loading branch information
snitin315 committed Oct 28, 2020
1 parent 132e3d1 commit 34ea4c1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
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

0 comments on commit 34ea4c1

Please sign in to comment.