From df3588cac943ae7c67f1258494bb3708c6f84d12 Mon Sep 17 00:00:00 2001 From: Sub <9058689+zubhav@users.noreply.github.com> Date: Thu, 5 May 2022 09:07:24 +0100 Subject: [PATCH] fix silent failing test --- packages/cli/tests/watch.test.js | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/packages/cli/tests/watch.test.js b/packages/cli/tests/watch.test.js index 49143d9ed..3dab0f5bd 100644 --- a/packages/cli/tests/watch.test.js +++ b/packages/cli/tests/watch.test.js @@ -89,7 +89,7 @@ describe('should determine the correct port', () => { expect(await determinePort('3999')).toBe(3999); }); - it('should use $PORT in the abscence of --port', async () => { + it('should use $PORT in the absence of --port', async () => { process.env.PORT = '4001'; expect(await determinePort()).toBe(4001); }); @@ -105,14 +105,10 @@ describe('should determine the correct port', () => { }); it('should return an error if requested --port is taken', async () => { - await Promise.all([determinePort(4003), determinePort(4003)]).catch( - error => { - expect(error.message).toMatch( - new RegExp( - /^Another process is already running on port 4003. Please choose a different port./g - ) - ); - } + expect( + Promise.all([determinePort(4003), determinePort(4003)]) + ).rejects.toThrow( + 'Another process is already running on port 4003. Please choose a different port.' ); });