fix(scripts): reject short flag vitest profile dirs

This commit is contained in:
Vincent Koc
2026-06-21 21:53:58 +02:00
parent 1a5839fbd8
commit 6399eb8191
2 changed files with 4 additions and 1 deletions
+1 -1
View File
@@ -12,7 +12,7 @@ import { createPnpmRunnerSpawnSpec } from "./pnpm-runner.mjs";
*/
function readOutputDirValue(argv, index) {
const value = argv[index + 1];
if (value === undefined || value === "" || value.startsWith("--")) {
if (value === undefined || value === "" || value.startsWith("-")) {
throw new Error("Expected --output-dir <dir>.");
}
return value;
+3
View File
@@ -91,6 +91,9 @@ describe("scripts/run-vitest-profile", () => {
it("rejects missing profile output directories", () => {
expect(() => parseArgs(["runner", "--output-dir"])).toThrow("Expected --output-dir <dir>.");
expect(() => parseArgs(["runner", "--output-dir", "-h"])).toThrow(
"Expected --output-dir <dir>.",
);
expect(() => parseArgs(["runner", "--output-dir", "--", "--config", "custom.ts"])).toThrow(
"Expected --output-dir <dir>.",
);