fix(scripts): reject short flag CI timing limits

This commit is contained in:
Vincent Koc
2026-06-21 22:34:22 +02:00
parent a0f28bd3f5
commit bebc5d847d
2 changed files with 8 additions and 2 deletions
+1 -1
View File
@@ -416,7 +416,7 @@ function consumePositiveIntFlag(args, index, flag) {
return null;
}
const rawValue = args[index + 1];
if (!rawValue || rawValue.startsWith("--")) {
if (!rawValue || rawValue.startsWith("-")) {
throw new Error(`${flag} requires a value`);
}
return {
+7 -1
View File
@@ -263,7 +263,13 @@ describe("scripts/ci-run-timings.mjs", () => {
});
it("rejects missing monitor limits instead of treating flags as values", () => {
for (const args of [["--limit"], ["--limit", "--recent", "4"], ["--recent"]]) {
for (const args of [
["--limit"],
["--limit", "--recent", "4"],
["--limit", "-h"],
["--recent"],
["--recent", "-h"],
]) {
expect(() => parseRunTimingArgs(args)).toThrow("requires a value");
}
});