fix(test): reject attestation platform flags

This commit is contained in:
Vincent Koc
2026-06-21 18:42:39 +02:00
parent d64a27feeb
commit 5bf459e23b
2 changed files with 2 additions and 1 deletions

View File

@@ -134,7 +134,7 @@ function inspectRaw(imageRef) {
function readOptionValue(argv, index, optionName) {
const value = argv[index + 1];
if (value === undefined || value === "" || value.startsWith("--")) {
if (value === undefined || value === "" || value.startsWith("-")) {
throw new Error(`${optionName} requires a value`);
}
return value;

View File

@@ -69,6 +69,7 @@ describe("verify-docker-attestations", () => {
it("rejects missing platform option values", () => {
expect(() => parseArgs(["--platform"])).toThrow("--platform requires a value");
expect(() => parseArgs(["--platform", "-h"])).toThrow("--platform requires a value");
expect(() => parseArgs(["--platform", "--help"])).toThrow("--platform requires a value");
expect(() => parseArgs(["--platform", ""])).toThrow("--platform requires a value");
});