From de10ddea16174f1cf23aa296983d41fbd3232c10 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Tue, 10 Feb 2026 04:48:13 +0000 Subject: [PATCH] Cover zero environment backend and web port rejection Co-authored-by: Theo Browne --- apps/t3/src/cli.test.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/apps/t3/src/cli.test.ts b/apps/t3/src/cli.test.ts index b08a5e740b..21dc648600 100644 --- a/apps/t3/src/cli.test.ts +++ b/apps/t3/src/cli.test.ts @@ -627,12 +627,24 @@ describe("parseCliOptions", () => { ); }); + it("throws for zero web environment port values", () => { + expect(() => parseCliOptions([], { T3_WEB_PORT: "0" }, "/workspace")).toThrow( + "Invalid value for T3_WEB_PORT", + ); + }); + it("throws for out-of-range backend environment port values", () => { expect(() => parseCliOptions([], { T3_BACKEND_PORT: "65536" }, "/workspace")).toThrow( "Invalid value for T3_BACKEND_PORT", ); }); + it("throws for zero backend environment port values", () => { + expect(() => parseCliOptions([], { T3_BACKEND_PORT: "0" }, "/workspace")).toThrow( + "Invalid value for T3_BACKEND_PORT", + ); + }); + it("throws for whitespace-only backend environment port values", () => { expect(() => parseCliOptions([], { T3_BACKEND_PORT: " " }, "/workspace")).toThrow( "Invalid value for T3_BACKEND_PORT",