Cover end-marker handling after flag value parsers

Co-authored-by: Theo Browne <[email protected]>
This commit is contained in:
Cursor AgentandTheo Browne committed 2026-02-10 01:38:53 +00:00
1 parent 79028d6952
commit d3f580dc95
1 file changed
+18
+18
View File
@@ -272,6 +272,12 @@ describe("parseCliOptions", () => {
);
});
it("treats end-of-options marker after --backend-port as missing value", () => {
expect(() => parseCliOptions(["--backend-port", "--"], {}, "/workspace")).toThrow(
"Missing value for --backend-port",
);
});
it("throws when web port value is missing", () => {
expect(() => parseCliOptions(["--web-port"], {}, "/workspace")).toThrow(
"Missing value for --web-port",
@@ -290,6 +296,12 @@ describe("parseCliOptions", () => {
);
});
it("treats end-of-options marker after --web-port as missing value", () => {
expect(() => parseCliOptions(["--web-port", "--"], {}, "/workspace")).toThrow(
"Missing value for --web-port",
);
});
it("throws for invalid environment port values", () => {
expect(() => parseCliOptions([], { T3_WEB_PORT: "nope" }, "/workspace")).toThrow(
"Invalid value for T3_WEB_PORT",
@@ -383,6 +395,12 @@ describe("parseCliOptions", () => {
);
});
it("treats end-of-options marker after --cwd as missing value", () => {
expect(() => parseCliOptions(["--cwd", "--"], {}, "/workspace")).toThrow(
"Missing value for --cwd",
);
});
it("throws for unknown arguments", () => {
expect(() => parseCliOptions(["--wat"], {}, "/workspace")).toThrow(
"Unknown argument: --wat",