Skip to content

Commit d7e2096

Browse files
committed
test: avoid redundant skip-report process
1 parent f04d18a commit d7e2096

1 file changed

Lines changed: 27 additions & 23 deletions

File tree

test/scripts/test-skip-inventory.test.ts

Lines changed: 27 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import path from "node:path";
55
import { describe, expect, it } from "vitest";
66
import {
77
collectTestSkipInventoryReport,
8+
main as runTestSkipInventory,
89
renderTestSkipInventoryReport,
910
type TestSkipInventoryReport,
1011
} from "../../scripts/test-skip-inventory.js";
@@ -260,29 +261,32 @@ describe("collectTestSkipInventoryReport", () => {
260261
});
261262

262263
it("rejects missing CLI repo roots and loose limits before scanning", () => {
263-
for (const args of [
264-
["--repo-root", "--json"],
265-
["--limit", "1e3", "--repo-root", createTempDir("openclaw-skip-limit-")],
266-
]) {
267-
const result = spawnSync(
268-
process.execPath,
269-
[
270-
"--import",
271-
"tsx",
272-
path.join(process.cwd(), "scripts/test-skip-inventory.ts"),
273-
"--",
274-
...args,
275-
],
276-
{
277-
encoding: "utf8",
278-
},
279-
);
264+
const result = spawnSync(
265+
process.execPath,
266+
[
267+
"--import",
268+
"tsx",
269+
path.join(process.cwd(), "scripts/test-skip-inventory.ts"),
270+
"--",
271+
"--repo-root",
272+
"--json",
273+
],
274+
{
275+
encoding: "utf8",
276+
},
277+
);
280278

281-
expect(result.status).toBe(1);
282-
expect(result.stderr).toMatch(
283-
/--repo-root expects a path|--limit expects a non-negative integer/u,
284-
);
285-
expect(result.stdout).not.toContain("Scanned files:");
286-
}
279+
expect(result.status).toBe(1);
280+
expect(result.stderr).toContain("--repo-root expects a path");
281+
expect(result.stdout).not.toContain("Scanned files:");
282+
expect(() =>
283+
runTestSkipInventory([
284+
"--",
285+
"--limit",
286+
"1e3",
287+
"--repo-root",
288+
createTempDir("openclaw-skip-limit-"),
289+
]),
290+
).toThrow("--limit expects a non-negative integer");
287291
});
288292
});

0 commit comments

Comments
 (0)