File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed
Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -126,19 +126,30 @@ export async function snapTest() {
126126 const casesDir = path . resolve ( values . dir || 'snap-tests' ) ;
127127
128128 const taskFunctions : ( ( ) => Promise < void > ) [ ] = [ ] ;
129+ const missingStepsJson : string [ ] = [ ] ;
129130 for ( const caseName of fs . readdirSync ( casesDir ) ) {
130131 if ( caseName . startsWith ( '.' ) ) {
131132 continue ;
132- } // Skip hidden files like .DS_Store
133- if ( ! fs . existsSync ( path . join ( casesDir , caseName , 'steps.json' ) ) ) {
134- console . warn ( 'Warning: %s has no steps.json, skipping' , caseName ) ;
133+ }
134+ const caseDir = path . join ( casesDir , caseName ) ;
135+ if ( ! fs . statSync ( caseDir ) . isDirectory ( ) ) {
136+ continue ;
137+ }
138+ if ( ! fs . existsSync ( path . join ( caseDir , 'steps.json' ) ) ) {
139+ missingStepsJson . push ( caseName ) ;
135140 continue ;
136141 }
137142 if ( caseName . includes ( filter ) ) {
138143 taskFunctions . push ( ( ) => runTestCase ( caseName , tempTmpDir , casesDir , values [ 'bin-dir' ] ) ) ;
139144 }
140145 }
141146
147+ if ( missingStepsJson . length > 0 ) {
148+ throw new Error (
149+ `${ missingStepsJson . length } test case(s) missing steps.json: ${ missingStepsJson . join ( ', ' ) } ` ,
150+ ) ;
151+ }
152+
142153 if ( taskFunctions . length > 0 ) {
143154 const cpuCount = cpus ( ) . length ;
144155 console . log (
You can’t perform that action at this time.
0 commit comments