Cover whitespace-only cwd flag rejection

Co-authored-by: Theo Browne <[email protected]>
This commit is contained in:
Cursor AgentandTheo Browne committed 2026-02-09 23:15:09 +00:00
1 parent f67a82e93c
commit e9cbb40c3d
1 file changed
+6
+6
View File
@@ -98,6 +98,12 @@ describe("parseCliOptions", () => {
);
});
it("throws for whitespace-only cwd flag values", () => {
expect(() => parseCliOptions(["--cwd", " "], {}, "/workspace")).toThrow(
"Invalid value for --cwd",
);
});
it("trims cwd flag values before resolving path", () => {
const options = parseCliOptions(["--cwd", " apps/renderer "], {}, "/workspace");
expect(options.launchCwd).toBe(path.resolve("apps/renderer"));