Skip to content

Commit

Permalink
[patch] fix reruning only prefiltered (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
mmisty authored Nov 10, 2023
1 parent f7f5443 commit 4a067d6
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/bin/cy-grep.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,16 +190,19 @@ try {
if (existsSync(prefilterFile)) {
// run all tests from prefiltered file or all
console.log(`${packagename} Will run tests from ${prefilterFile}`);
const existingGrep = grep;

if (!grep) {
try {
// update grep from prefiltered file
grep = JSON.parse(readFileSync(prefilterFile)).grep;
grepExpression = getGrepEnvVariableStr(grep);
} catch (e) {
console.log(`${packagename} Could not read/parse ${prefilterFile}: ${e.message}`);
}
try {
// update grep from prefiltered file
grep = JSON.parse(readFileSync(prefilterFile)).grep;
} catch (e) {
console.log(`${packagename} Could not read/parse ${prefilterFile}: ${e.message}`);
}

if (existingGrep) {
grep = `(${grep}&(${existingGrep}))`;
}
grepExpression = getGrepEnvVariableStr(grep);
} else {
resultsFileEnvVariableStr = '';
console.log(
Expand Down

0 comments on commit 4a067d6

Please sign in to comment.