Cover zero explicit backend and web port rejection

Co-authored-by: Theo Browne <[email protected]>
This commit is contained in:
Cursor AgentandTheo Browne committed 2026-02-10 04:47:18 +00:00
1 parent c9b921c532
commit c557259673
1 file changed
+12
+12
View File
@@ -465,6 +465,12 @@ describe("parseCliOptions", () => {
);
});
it("throws for zero backend explicit port values", () => {
expect(() => parseCliOptions(["--backend-port", "0"], {}, "/workspace")).toThrow(
"Invalid value for --backend-port",
);
});
it("throws for empty equals-style backend port values", () => {
expect(() => parseCliOptions(["--backend-port="], {}, "/workspace")).toThrow(
"Invalid value for --backend-port",
@@ -543,6 +549,12 @@ describe("parseCliOptions", () => {
);
});
it("rejects zero web port values provided as separate args", () => {
expect(() => parseCliOptions(["--web-port", "0"], {}, "/workspace")).toThrow(
"Invalid value for --web-port",
);
});
it("treats known flags after --web-port as missing values", () => {
expect(() => parseCliOptions(["--web-port", "--cwd"], {}, "/workspace")).toThrow(
"Missing value for --web-port",