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

fix: print log entries if logging happens after teardown #7731

Merged
merged 16 commits into from
Jan 29, 2019
Prev Previous commit
Next Next commit
fix force exit test
  • Loading branch information
SimenB committed Jan 29, 2019
commit 272fcbd98753423fe79eb55d286fd1bd5408b50e
9 changes: 4 additions & 5 deletions e2e/__tests__/forceExit.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,17 @@ test('exits the process after test are done but before timers complete', () => {
'package.json': JSON.stringify({jest: {testEnvironment: 'node'}}),
});

let stdout;
SimenB marked this conversation as resolved.
Show resolved Hide resolved
let stderr;
({stdout, stderr} = runJest(DIR));
({stderr} = runJest(DIR));
expect(stderr).toMatch(/PASS.*test\.test\.js/);
expect(stdout).toMatch(/TIMER_DONE/);
expect(stderr).toMatch(/TIMER_DONE/);
writeFiles(DIR, {
'package.json': JSON.stringify({
jest: {forceExit: true, testEnvironment: 'node'},
}),
});

({stdout, stderr} = runJest(DIR));
({stderr} = runJest(DIR));
expect(stderr).toMatch(/PASS.*test\.test\.js/);
expect(stdout).not.toMatch(/TIMER_DONE/);
expect(stderr).not.toMatch(/TIMER_DONE/);
});