Skip to content

Commit e0b92f9

Browse files
arichard-infolgandecki
authored andcommitted
fix(tags): adding conditions to avoid features running if no matching tags are found
1 parent 152ccdd commit e0b92f9

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

cypress-tags.js

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,18 @@ paths.forEach(featurePath => {
5555
});
5656

5757
try {
58-
execFileSync(
59-
process.platform === "win32"
60-
? `${__dirname}/../.bin/cypress.cmd`
61-
: `${__dirname}/../.bin/cypress`,
62-
[...process.argv.slice(2), "--spec", featuresToRun.join(",")],
63-
{
64-
stdio: [process.stdin, process.stdout, process.stderr]
65-
}
66-
);
58+
if (featuresToRun.length || envTags === "") {
59+
execFileSync(
60+
`${__dirname}/../.bin/cypress`,
61+
[...process.argv.slice(2), "--spec", featuresToRun.join(",")],
62+
{
63+
stdio: [process.stdin, process.stdout, process.stderr]
64+
}
65+
);
66+
} else {
67+
console.log("No matching tags found");
68+
process.exit(0);
69+
}
6770
} catch (e) {
6871
debug("Error while running cypress (or just a test failure)", e);
6972
process.exit(1);

0 commit comments

Comments
 (0)