mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-09 03:22:40 +00:00
fix(test): reject loose env report limits
This commit is contained in:
@@ -182,4 +182,29 @@ describe("collectTestEnvMutationReport", () => {
|
||||
expect(result.status).toBe(1);
|
||||
expect(result.stderr).toContain("--repo-root expects a path");
|
||||
});
|
||||
|
||||
it("rejects loose CLI limits before scanning the repository", () => {
|
||||
for (const limit of ["1e3", ""]) {
|
||||
const result = spawnSync(
|
||||
process.execPath,
|
||||
[
|
||||
"--import",
|
||||
"tsx",
|
||||
path.join(process.cwd(), "scripts/test-env-mutation-report.ts"),
|
||||
"--",
|
||||
"--limit",
|
||||
limit,
|
||||
"--repo-root",
|
||||
createTempDir("openclaw-env-limit-"),
|
||||
],
|
||||
{
|
||||
encoding: "utf8",
|
||||
},
|
||||
);
|
||||
|
||||
expect(result.status).toBe(1);
|
||||
expect(result.stderr).toContain("--limit expects a non-negative integer");
|
||||
expect(result.stdout).not.toContain("Scanned files:");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user