diff --git a/lib/__tests__/unit/server.unit.test.ts b/lib/__tests__/unit/server.unit.test.ts index 7d7d39b..426c245 100644 --- a/lib/__tests__/unit/server.unit.test.ts +++ b/lib/__tests__/unit/server.unit.test.ts @@ -101,12 +101,12 @@ describe('WebSocket checks', () => { expect(() => new WebSocket('typo')).toThrow(SyntaxError); - expect(() => new WebSocket('invalid://websocket-echo.com')).toThrow(new Error('The URL\'s protocol must be one of "ws:", "wss:", ' + '"http:", "https", or "ws+unix:"')); + expect(() => new WebSocket('invalid://websocket-echo.com')).toThrow(new Error('The URL\'s protocol must be one of "ws:", "wss:", or "ws+unix:"')); // URL's pathname is empty expect(() => new WebSocket('ws+unix:')).toThrow(SyntaxError); - expect(() => new WebSocket('wss://websocket-echo.com#foo')).toThrow(/^SyntaxError: The URL contains a fragment identifier$/); + expect(() => new WebSocket('wss://websocket-echo.com#foo')).toThrow(/The URL contains a fragment identifier/); }); afterAll((done) => {