teach tests about the new way we fail websockets

This commit is contained in:
dakkar 2025-09-19 13:33:22 +01:00
parent e111d8aa55
commit 77852b8cce
3 changed files with 11 additions and 2 deletions

View file

@ -734,6 +734,9 @@ describe('Streaming', () => {
const socket = new WebSocket(`ws://127.0.0.1:${port}/streaming?i=${application}`);
const established = await new Promise<boolean>((resolve, reject) => {
socket.on('error', () => resolve(false));
socket.on('close', (code, reason) => {
if (code === 4000) resolve(false);
});
socket.on('unexpected-response', () => resolve(false));
setTimeout(() => resolve(true), 3000);
});