fix(test): reject env report flag paths · openclaw/openclaw@12756fc
vincentkoc
·
2026-06-22
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -163,24 +163,26 @@ describe("collectTestEnvMutationReport", () => {
|
163 | 163 | expect(result.stderr).toBe(""); |
164 | 164 | }); |
165 | 165 | |
166 | | -it("rejects missing CLI repo roots instead of scanning zero files", () => { |
167 | | -const result = spawnSync( |
168 | | -process.execPath, |
169 | | -[ |
170 | | -"--import", |
171 | | -"tsx", |
172 | | -path.join(process.cwd(), "scripts/test-env-mutation-report.ts"), |
173 | | -"--", |
174 | | -"--repo-root", |
175 | | -"--json", |
176 | | -], |
177 | | -{ |
178 | | -encoding: "utf8", |
179 | | -}, |
180 | | -); |
| 166 | +it("rejects missing or flag-shaped CLI repo roots instead of scanning zero files", () => { |
| 167 | +for (const value of ["--json", "-h"]) { |
| 168 | +const result = spawnSync( |
| 169 | +process.execPath, |
| 170 | +[ |
| 171 | +"--import", |
| 172 | +"tsx", |
| 173 | +path.join(process.cwd(), "scripts/test-env-mutation-report.ts"), |
| 174 | +"--", |
| 175 | +"--repo-root", |
| 176 | +value, |
| 177 | +], |
| 178 | +{ |
| 179 | +encoding: "utf8", |
| 180 | +}, |
| 181 | +); |
181 | 182 | |
182 | | -expect(result.status).toBe(1); |
183 | | -expect(result.stderr).toContain("--repo-root expects a path"); |
| 183 | +expect(result.status).toBe(1); |
| 184 | +expect(result.stderr).toContain("--repo-root expects a path"); |
| 185 | +} |
184 | 186 | }); |
185 | 187 | |
186 | 188 | it("rejects loose CLI limits before scanning the repository", () => { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。