Skip to content

Commit

Permalink
[patch] fix 2 (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
mmisty authored Jan 9, 2024
1 parent 88367df commit 7dbe51e
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions src/bin/cy-grep.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,11 +237,19 @@ try {
let specPattern = getSpecPattern(fileSpecPatternOriginal);
let specString = getSpecPatternVar(specPattern, grep, onlyRun);

if (process.env['CYPRESS_GREP_failOnNotFound'] === 'false' && specString === 'CYPRESS_SPEC_PATTERN="[]"') {
console.log(`${packagename} Not found any specs matching ${grepExpression}`);
console.log(`${packagename} To throw error when not found set CYPRESS_GREP_failOnNotFound to true`);
console.log(`${packagename} FINISHED (exit code: 0) === `);
process.exit(0);
if (process.env['CYPRESS_GREP_failOnNotFound'] === 'false') {
if (prefilterFile && existsSync(prefilterFile) && JSON.parse(readFileSync(prefilterFile)).tests?.length === 0) {
console.log(`${packagename} Not found any specs matching ${grepExpression}`);
console.log(`${packagename} To throw error when not found set CYPRESS_GREP_failOnNotFound to true`);
console.log(`${packagename} FINISHED (exit code: 0) === `);

if (!onlyRun && !onlyPrefilter && deletePrefiltered && existsSync(prefilterFile)) {
rmSync(prefilterFile);
}
process.exit(0);

return;
}
}

console.log(`${packagename} Running tests === `);
Expand Down

0 comments on commit 7dbe51e

Please sign in to comment.