Skip to content

Commit

Permalink
fix uncaught/strict test
Browse files Browse the repository at this point in the history
Signed-off-by: Christopher Hiller <boneskull@boneskull.com>
  • Loading branch information
boneskull committed Oct 30, 2020
1 parent 562b94a commit abc4855
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions test/integration/uncaught.spec.js
Expand Up @@ -181,11 +181,8 @@ describe('uncaught exceptions', function() {
describe('when Node is in "warn" mode', function() {
it('should warn', async function() {
const [, promise] = invokeMochaAsync(
[
resolveFixturePath('uncaught/unhandled'),
'--unhandled-rejections=warn'
],
{stdio: 'pipe'}
[resolveFixturePath('uncaught/unhandled')],
{stdio: 'pipe', unhandledRejections: 'warn'}
);

return expect(
Expand All @@ -198,19 +195,16 @@ describe('uncaught exceptions', function() {
});

describe('when Node is in "strict" mode', function() {
it('should fail', async function() {
it('should fail with an uncaught exception', async function() {
const [, promise] = invokeMochaAsync(
[
resolveFixturePath('uncaught/unhandled'),
'--unhandled-rejections=strict'
],
{stdio: 'pipe'}
[resolveFixturePath('uncaught/unhandled')],
{stdio: 'pipe', unhandledRejections: 'strict'}
);
return expect(
promise,
'when fulfilled',
'to have failed with output',
/'ERR_UNHANDLED_REJECTION'/
/Uncaught Error: yikes/
);
});
});
Expand Down

0 comments on commit abc4855

Please sign in to comment.