mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-21 10:16:44 +00:00
test: avoid redundant skip-report process
This commit is contained in:
@@ -5,6 +5,7 @@ import path from "node:path";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import {
|
||||
collectTestSkipInventoryReport,
|
||||
main as runTestSkipInventory,
|
||||
renderTestSkipInventoryReport,
|
||||
type TestSkipInventoryReport,
|
||||
} from "../../scripts/test-skip-inventory.js";
|
||||
@@ -260,29 +261,32 @@ describe("collectTestSkipInventoryReport", () => {
|
||||
});
|
||||
|
||||
it("rejects missing CLI repo roots and loose limits before scanning", () => {
|
||||
for (const args of [
|
||||
["--repo-root", "--json"],
|
||||
["--limit", "1e3", "--repo-root", createTempDir("openclaw-skip-limit-")],
|
||||
]) {
|
||||
const result = spawnSync(
|
||||
process.execPath,
|
||||
[
|
||||
"--import",
|
||||
"tsx",
|
||||
path.join(process.cwd(), "scripts/test-skip-inventory.ts"),
|
||||
"--",
|
||||
...args,
|
||||
],
|
||||
{
|
||||
encoding: "utf8",
|
||||
},
|
||||
);
|
||||
const result = spawnSync(
|
||||
process.execPath,
|
||||
[
|
||||
"--import",
|
||||
"tsx",
|
||||
path.join(process.cwd(), "scripts/test-skip-inventory.ts"),
|
||||
"--",
|
||||
"--repo-root",
|
||||
"--json",
|
||||
],
|
||||
{
|
||||
encoding: "utf8",
|
||||
},
|
||||
);
|
||||
|
||||
expect(result.status).toBe(1);
|
||||
expect(result.stderr).toMatch(
|
||||
/--repo-root expects a path|--limit expects a non-negative integer/u,
|
||||
);
|
||||
expect(result.stdout).not.toContain("Scanned files:");
|
||||
}
|
||||
expect(result.status).toBe(1);
|
||||
expect(result.stderr).toContain("--repo-root expects a path");
|
||||
expect(result.stdout).not.toContain("Scanned files:");
|
||||
expect(() =>
|
||||
runTestSkipInventory([
|
||||
"--",
|
||||
"--limit",
|
||||
"1e3",
|
||||
"--repo-root",
|
||||
createTempDir("openclaw-skip-limit-"),
|
||||
]),
|
||||
).toThrow("--limit expects a non-negative integer");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user