The best way to control Claude Code, Codex and more from any computer or phone
fix(server): use waitForPush in terminal event broadcast test to prevent flaky failure (#606)
The terminal RPC test used raw waitForMessage to receive the expected terminal.event push, but a server.configUpdated push from the keybindings file watcher can arrive first depending on OS timing. Replace with the existing waitForPush helper that filters by channel.
0x1f99d committed
Mar 9, 2026 at 14:36 UTC
3738373aa5ff0fff074ecb95686ef952c209957e
1 file changed
+1
-3
apps/server/src/wsServer.test.ts
+1
-3
@@ -1333,9 +1333,7 @@ describe("WebSocket Server", () => {
1333
};
1334
terminalManager.emitEvent(manualEvent);
1335
1336
- const push = (await waitForMessage(ws)) as WsPush;
1337
- expect(push.type).toBe("push");
1338
- expect(push.channel).toBe(WS_CHANNELS.terminalEvent);
1336
+ const push = await waitForPush(ws, WS_CHANNELS.terminalEvent);
1337
expect((push.data as TerminalEvent).type).toBe("output");
1338
});
1339