Skip to content

Commit

Permalink
combine output streams in forceexit test
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB committed Jan 29, 2019
1 parent ad4633c commit ff7990c
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions e2e/__tests__/forceExit.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,25 @@ test('exits the process after test are done but before timers complete', () => {
'package.json': JSON.stringify({jest: {testEnvironment: 'node'}}),
});

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

output = `${stdout}\n${stderr}`;

expect(output).toMatch(/PASS.*test\.test\.js/);
expect(output).toMatch(/TIMER_DONE/);
writeFiles(DIR, {
'package.json': JSON.stringify({
jest: {forceExit: true, testEnvironment: 'node'},
}),
});

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

output = `${stdout}\n${stderr}`;

expect(output).toMatch(/PASS.*test\.test\.js/);
expect(output).not.toMatch(/TIMER_DONE/);
});

0 comments on commit ff7990c

Please sign in to comment.