@@ -5,6 +5,7 @@ import path from "node:path";
55import { describe , expect , it } from "vitest" ;
66import {
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- / - - r e p o - r o o t e x p e c t s a p a t h | - - l i m i t e x p e c t s a n o n - n e g a t i v e i n t e g e r / 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