diff --git a/scripts/test-group-report.mjs b/scripts/test-group-report.mjs index 81baed79d53b..06c8f5810a10 100644 --- a/scripts/test-group-report.mjs +++ b/scripts/test-group-report.mjs @@ -64,7 +64,7 @@ function usage() { function readRequiredValue(argv, index, flag) { const value = argv[index + 1]; - if (!value || value.startsWith("--")) { + if (!value || value.startsWith("-")) { throw new Error(`${flag} requires a value`); } return value; diff --git a/test/scripts/test-group-report.test.ts b/test/scripts/test-group-report.test.ts index 0065c69ce79b..5186d5d4146a 100644 --- a/test/scripts/test-group-report.test.ts +++ b/test/scripts/test-group-report.test.ts @@ -592,6 +592,7 @@ describe("scripts/test-group-report arg parsing", () => { expect(() => parseTestGroupReportArgs([flag, "--limit", "5"])).toThrow( `${flag} requires a value`, ); + expect(() => parseTestGroupReportArgs([flag, "-h"])).toThrow(`${flag} requires a value`); } for (const flag of [ "--limit",