File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 7171 "postpack" : " sf-clean --ignore-signing-artifacts" ,
7272 "prepack" : " sf-prepack" ,
7373 "test" : " wireit" ,
74- "test:nuts" : " nyc mocha \" **/*.nut.ts \" --slow 4500 --timeout 600000 --parallel " ,
74+ "test:nuts" : " node scripts/run-nuts.cjs " ,
7575 "test:only" : " wireit" ,
7676 "version" : " oclif readme"
7777 },
Original file line number Diff line number Diff line change 1+ 'use strict' ;
2+
3+ const { readdirSync, existsSync } = require ( 'fs' ) ;
4+ const { join } = require ( 'path' ) ;
5+ const { execSync } = require ( 'child_process' ) ;
6+
7+ function findNutFiles ( dir , results = [ ] ) {
8+ if ( ! existsSync ( dir ) ) return results ;
9+ for ( const entry of readdirSync ( dir , { withFileTypes : true } ) ) {
10+ if ( entry . name === 'node_modules' ) continue ;
11+ const fullPath = join ( dir , entry . name ) ;
12+ if ( entry . isDirectory ( ) ) {
13+ findNutFiles ( fullPath , results ) ;
14+ } else if ( entry . name . endsWith ( '.nut.ts' ) ) {
15+ results . push ( fullPath ) ;
16+ }
17+ }
18+ return results ;
19+ }
20+
21+ const nutFiles = findNutFiles ( '.' ) ;
22+
23+ if ( nutFiles . length === 0 ) {
24+ console . log ( 'No NUT files found, skipping.' ) ;
25+ process . exit ( 0 ) ;
26+ }
27+
28+ execSync ( 'nyc mocha "**/*.nut.ts" --slow 4500 --timeout 600000 --parallel' , {
29+ stdio : 'inherit' ,
30+ shell : true ,
31+ } ) ;
You can’t perform that action at this time.
0 commit comments