From d7e2096dc78e8a3aad5c82821ca16fc269202a5a Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sun, 5 Jul 2026 14:25:57 -0400 Subject: [PATCH] test: avoid redundant skip-report process --- test/scripts/test-skip-inventory.test.ts | 50 +++++++++++++----------- 1 file changed, 27 insertions(+), 23 deletions(-) diff --git a/test/scripts/test-skip-inventory.test.ts b/test/scripts/test-skip-inventory.test.ts index f5bb48d4511f..d599c470e671 100644 --- a/test/scripts/test-skip-inventory.test.ts +++ b/test/scripts/test-skip-inventory.test.ts @@ -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"); }); });