File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -237,11 +237,19 @@ try {
237
237
let specPattern = getSpecPattern ( fileSpecPatternOriginal ) ;
238
238
let specString = getSpecPatternVar ( specPattern , grep , onlyRun ) ;
239
239
240
- if ( process . env [ 'CYPRESS_GREP_failOnNotFound' ] === 'false' && specString === 'CYPRESS_SPEC_PATTERN="[]"' ) {
241
- console . log ( `${ packagename } Not found any specs matching ${ grepExpression } ` ) ;
242
- console . log ( `${ packagename } To throw error when not found set CYPRESS_GREP_failOnNotFound to true` ) ;
243
- console . log ( `${ packagename } FINISHED (exit code: 0) === ` ) ;
244
- process . exit ( 0 ) ;
240
+ if ( process . env [ 'CYPRESS_GREP_failOnNotFound' ] === 'false' ) {
241
+ if ( prefilterFile && existsSync ( prefilterFile ) && JSON . parse ( readFileSync ( prefilterFile ) ) . tests ?. length === 0 ) {
242
+ console . log ( `${ packagename } Not found any specs matching ${ grepExpression } ` ) ;
243
+ console . log ( `${ packagename } To throw error when not found set CYPRESS_GREP_failOnNotFound to true` ) ;
244
+ console . log ( `${ packagename } FINISHED (exit code: 0) === ` ) ;
245
+
246
+ if ( ! onlyRun && ! onlyPrefilter && deletePrefiltered && existsSync ( prefilterFile ) ) {
247
+ rmSync ( prefilterFile ) ;
248
+ }
249
+ process . exit ( 0 ) ;
250
+
251
+ return ;
252
+ }
245
253
}
246
254
247
255
console . log ( `${ packagename } Running tests === ` ) ;
You can’t perform that action at this time.
0 commit comments