fix(release): validate plugin manifest runner args · openclaw/openclaw@1db8112
vincentkoc
·
2026-06-21
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -13,9 +13,24 @@ describe("plugin-npm-package-manifest run args", () => {
|
13 | 13 | }); |
14 | 14 | }); |
15 | 15 | |
| 16 | +it("returns help before resolving package dirs", () => { |
| 17 | +expect(parseRunArgs(["--help"])).toEqual({ |
| 18 | +help: true, |
| 19 | +packageDir: "", |
| 20 | +command: "", |
| 21 | +args: [], |
| 22 | +}); |
| 23 | +}); |
| 24 | + |
16 | 25 | it("rejects missing or option-looking package dirs", () => { |
17 | 26 | expect(() => parseRunArgs(["--run"])).toThrow(usage); |
18 | 27 | expect(() => parseRunArgs(["--run", "--", "npm", "pack"])).toThrow(usage); |
19 | 28 | expect(() => parseRunArgs(["--run", "--bad", "--", "npm", "pack"])).toThrow(usage); |
20 | 29 | }); |
| 30 | + |
| 31 | +it("rejects unexpected args before the command separator", () => { |
| 32 | +expect(() => parseRunArgs(["--run", "extensions/slack", "extra", "--", "npm"])).toThrow( |
| 33 | +"unexpected plugin npm package manifest run argument: extra", |
| 34 | +); |
| 35 | +}); |
21 | 36 | }); |
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。