fix(test): guard issue labeler cli args · openclaw/openclaw@622955b
vincentkoc
·
2026-06-20
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -16,6 +16,20 @@ describe("label-open-issues helpers", () => {
|
16 | 16 | vi.useRealTimers(); |
17 | 17 | }); |
18 | 18 | |
| 19 | +it("parses CLI options strictly before external calls", () => { |
| 20 | +expect(testing.parseArgs(["--dry-run", "--limit", "2", "--model", "gpt-5.5"])).toEqual({ |
| 21 | +dryRun: true, |
| 22 | +limit: 2, |
| 23 | +model: "gpt-5.5", |
| 24 | +}); |
| 25 | + |
| 26 | +expect(() => testing.parseArgs(["--model", "--dry-run"])).toThrow("Missing --model value"); |
| 27 | +expect(() => testing.parseArgs(["--limit", "--dry-run"])).toThrow( |
| 28 | +"Missing/invalid --limit value", |
| 29 | +); |
| 30 | +expect(() => testing.parseArgs(["--wat"])).toThrow("Unknown argument: --wat"); |
| 31 | +}); |
| 32 | + |
19 | 33 | it("classifies items from OpenAI structured response text", async () => { |
20 | 34 | const response = new Response( |
21 | 35 | JSON.stringify({ |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。