From abc48556b81496f42e78d1395125dceb6bd42bcf Mon Sep 17 00:00:00 2001 From: Christopher Hiller Date: Fri, 30 Oct 2020 11:16:24 -0700 Subject: [PATCH] fix uncaught/strict test Signed-off-by: Christopher Hiller --- test/integration/uncaught.spec.js | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/test/integration/uncaught.spec.js b/test/integration/uncaught.spec.js index 9c67dd16a9..106e15a145 100644 --- a/test/integration/uncaught.spec.js +++ b/test/integration/uncaught.spec.js @@ -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( @@ -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/ ); }); });