

























@@ -21,6 +21,44 @@ afterEach(() => {
2121});
22222323describe("notarize-mac-artifact input validation", () => {
24+it("prints help without checking artifact or notary tools", () => {
25+const result = spawnSync("bash", [scriptPath, "--help"], {
26+cwd: process.cwd(),
27+encoding: "utf8",
28+});
29+30+expect(result.status).toBe(0);
31+expect(result.stdout).toContain("Usage: scripts/notarize-mac-artifact.sh <artifact>");
32+expect(result.stdout).toContain("NOTARYTOOL_PROFILE");
33+expect(result.stderr).toBe("");
34+});
35+36+it("rejects unknown options before artifact validation", () => {
37+const result = spawnSync("bash", [scriptPath, "--wat"], {
38+cwd: process.cwd(),
39+encoding: "utf8",
40+});
41+42+expect(result.status).toBe(1);
43+expect(result.stdout).toBe("");
44+expect(result.stderr.trim()).toBe("Error: unknown notarization option: --wat");
45+});
46+47+it("rejects extra artifact arguments before notarization", () => {
48+const tempRoot = makeTempDir("openclaw-notary-extra-");
49+const artifact = path.join(tempRoot, "OpenClaw.zip");
50+writeFileSync(artifact, "placeholder", "utf8");
51+52+const result = spawnSync("bash", [scriptPath, artifact, "extra"], {
53+cwd: process.cwd(),
54+encoding: "utf8",
55+});
56+57+expect(result.status).toBe(1);
58+expect(result.stdout).toBe("");
59+expect(result.stderr.trim()).toBe("Error: unexpected notarization argument: extra");
60+});
61+2462it("fails before notarization when an explicit staple app path is missing", () => {
2563const tempRoot = makeTempDir("openclaw-notary-staple-");
2664const artifact = path.join(tempRoot, "OpenClaw.zip");
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。