Skip to content

Commit

Permalink
enable running tests that have no grep enabled yet
Browse files Browse the repository at this point in the history
  • Loading branch information
tomsonpl committed Sep 11, 2023
1 parent 93ba71c commit 752971c
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ ${JSON.stringify(cypressConfigFile, null, 2)}

const isGrepReturnedFilePaths = _.isArray(grepSpecPattern);
const isGrepReturnedSpecPattern = !isGrepReturnedFilePaths && grepSpecPattern === specPattern;
const { grepFilterSpecs } = cypressConfigFile.env;

// IMPORTANT!
// When grep returns the same spec pattern as it gets in its arguments, we treat it as
Expand All @@ -136,7 +137,7 @@ ${JSON.stringify(cypressConfigFile, null, 2)}
// If we don't return early, these specs will start executing, and Cypress will be skipping
// tests at runtime: those that should be excluded according to the tags passed in the config.
// This can take so much time that the job can fail by timeout in CI.
if (isGrepReturnedSpecPattern) {
if (grepFilterSpecs && isGrepReturnedSpecPattern) {
log.info('No tests found - all tests could have been skipped via Cypress tags');
// eslint-disable-next-line no-process-exit
return process.exit(0);
Expand Down

0 comments on commit 752971c

Please sign in to comment.