diff --git a/scripts/e2e/parallels/provider-auth.ts b/scripts/e2e/parallels/provider-auth.ts index 25c210ccd426..e5016bcf2b4d 100644 --- a/scripts/e2e/parallels/provider-auth.ts +++ b/scripts/e2e/parallels/provider-auth.ts @@ -20,7 +20,7 @@ export function parseBoolEnv(value: string | undefined): boolean { export function ensureValue(args: string[], index: number, flag: string): string { const value = args[index + 1]; - if (value == null || value === "") { + if (value == null || value === "" || value.startsWith("-")) { die(`${flag} requires a value`); } return value; diff --git a/test/scripts/parallels-smoke-model.test.ts b/test/scripts/parallels-smoke-model.test.ts index 2c50b7217cb7..a3d3da0a993b 100644 --- a/test/scripts/parallels-smoke-model.test.ts +++ b/test/scripts/parallels-smoke-model.test.ts @@ -351,6 +351,25 @@ describe("Parallels smoke model selection", () => { ).toBe(false); }); + it("rejects short flags as Parallels smoke option values", () => { + const cases = [ + [TS_PATHS.linux, "--mode", "-h"], + [TS_PATHS.macos, "--vm", "-h"], + [TS_PATHS.windows, "--model", "-h"], + [TS_PATHS.npmUpdate, "--target-tarball", "-h"], + ]; + + for (const [scriptPath, flag, value] of cases) { + const result = spawnNodeEvalSync( + `process.argv = ["node", "${scriptPath}", "${flag}", "${value}"]; await import("./${scriptPath}");`, + { env: process.env, imports: ["tsx"] }, + ); + + expect(result.status).toBe(1); + expect(result.stderr).toContain(`error: ${flag} requires a value`); + } + }); + it("keeps provider auth and model defaults in the shared TypeScript helper", () => { const providerAuth = readFileSync(TS_PATHS.providerAuth, "utf8");