Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,6 @@ function parseOptions(
{ argv, partial },
);
} catch (e) {
assert(!partial, "Partial option parsing should not have failed");
return messageError("DriverCLIOptionParsingFailed", {
message: exceptionToString(e),
});
Expand Down
15 changes: 15 additions & 0 deletions test/unit/cli-options.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { describe, expect, test } from "vitest";

import { parseCLIOptions } from "../../src/index.js";

describe("CLI option parsing", () => {
test("reports a duplicate output option as a user input error", () => {
expect(() =>
parseCLIOptions(["-o", "list.go", "-o", "list.ts"]),
).toThrow(/^Option parsing failed: .*Singular option already set/);

expect(() =>
parseCLIOptions(["-o", "list.go", "-o", "list.ts"]),
).not.toThrow("Internal error");
});
});
Loading