Cover strict-invalid websocket envelopes in renderer adapter tests

Co-authored-by: Theo Browne <[email protected]>
This commit is contained in:
Cursor AgentandTheo Browne committed 2026-02-10 11:32:29 +00:00
1 parent 730e30a6bb
commit 0ba9932438
1 file changed
+32
+32
View File
@@ -2705,6 +2705,29 @@ describe("wsNativeApi", () => {
socket?.emitMessage("not json");
socket?.emitMessage(JSON.stringify({ type: "event", channel: "unknown", payload: null }));
socket?.emitMessage(
JSON.stringify({
type: "hello",
version: 1,
launchCwd: "/workspace",
unexpected: true,
}),
);
socket?.emitMessage(
JSON.stringify({
type: "event",
channel: "provider:event",
payload: {
id: "evt-1",
kind: "notification",
provider: "codex",
sessionId: "sess-1",
createdAt: "2026-02-01T00:00:00.000Z",
method: "turn/started",
},
unexpected: true,
}),
);
socket?.emitMessage(
JSON.stringify({
type: "response",
@@ -2724,6 +2747,15 @@ describe("wsNativeApi", () => {
},
}),
);
socket?.emitMessage(
JSON.stringify({
type: "response",
id: requestEnvelope.id,
ok: true,
result: [],
unexpected: true,
}),
);
socket?.emitMessage(
JSON.stringify({
type: "response",