Skip to content
TypeScript

fix(server): use waitForPush in terminal event broadcast test to prevent flaky failure (#606)

0x1f99d3738373aa5ff
diff --git a/apps/server/src/wsServer.test.ts b/apps/server/src/wsServer.test.ts
index 285028cca6e..80d57d7c6f9 100644
--- a/apps/server/src/wsServer.test.ts
+++ b/apps/server/src/wsServer.test.ts
@@ -1333,9 +1333,7 @@ describe("WebSocket Server", () => {
};
terminalManager.emitEvent(manualEvent);
- const push = (await waitForMessage(ws)) as WsPush;
- expect(push.type).toBe("push");
- expect(push.channel).toBe(WS_CHANNELS.terminalEvent);
+ const push = await waitForPush(ws, WS_CHANNELS.terminalEvent);
expect((push.data as TerminalEvent).type).toBe("output");
});