Cover whitespace-only cwd flag rejection
Co-authored-by: Theo Browne <[email protected]>
This commit is contained in:
1 parent
f67a82e93c
commit
e9cbb40c3d
1 file changed
+6
@@ -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"));
|
||||
|
||||
Reference in new issue
Block a user