From cab673a1059c63b2cf65217539769d732ab61aa1 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Tue, 10 Feb 2026 02:18:33 +0000 Subject: [PATCH] Cover NaN and infinite runtime port rejection Co-authored-by: Theo Browne --- apps/t3/src/runtimeApiServer.test.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/apps/t3/src/runtimeApiServer.test.ts b/apps/t3/src/runtimeApiServer.test.ts index baf5f1f0b0..3fdcddb253 100644 --- a/apps/t3/src/runtimeApiServer.test.ts +++ b/apps/t3/src/runtimeApiServer.test.ts @@ -185,6 +185,24 @@ describe("runtimeApiServer", () => { ).rejects.toThrow("Invalid runtime port"); }); + it("rejects startup when runtime port is NaN", async () => { + await expect( + startRuntimeApiServer({ + port: Number.NaN, + launchCwd: process.cwd(), + }), + ).rejects.toThrow("Invalid runtime port"); + }); + + it("rejects startup when runtime port is infinite", async () => { + await expect( + startRuntimeApiServer({ + port: Number.POSITIVE_INFINITY, + launchCwd: process.cwd(), + }), + ).rejects.toThrow("Invalid runtime port"); + }); + it("allows runtime server close to be called multiple times", async () => { const server = await startRuntimeApiServer({ port: 0,