From 45fcdef07f832b4338ce4baea924a153f1f11c3b Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Mon, 9 Feb 2026 23:19:36 +0000 Subject: [PATCH] Cover no-auth websocket connection behavior Co-authored-by: Theo Browne --- apps/t3/src/runtimeApiServer.test.ts | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/apps/t3/src/runtimeApiServer.test.ts b/apps/t3/src/runtimeApiServer.test.ts index 66fd33b68b..80a3a20206 100644 --- a/apps/t3/src/runtimeApiServer.test.ts +++ b/apps/t3/src/runtimeApiServer.test.ts @@ -116,6 +116,27 @@ describe("runtimeApiServer", () => { ).rejects.toThrow("Invalid runtime auth token"); }); + it("accepts websocket connections without token when auth is disabled", async () => { + const server = await startRuntimeApiServer({ + port: 0, + launchCwd: process.cwd(), + }); + servers.push(server); + + const client = await connectClient(server.wsUrl); + const hello = await client.nextMessage(); + expect(hello.type).toBe("hello"); + + const response = await sendRequest( + client.socket, + client.nextMessage, + "todos-no-auth-1", + "todos.list", + ); + expect(response.ok).toBe(true); + client.socket.close(); + }); + it("responds to todos.list over websocket RPC", async () => { const server = await startRuntimeApiServer({ port: 0,