Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Commit fc9e4ca

Browse files
author
Edgar Cruzado
authored
include and excloude should work with tags (#537)
1 parent b8c1cd4 commit fc9e4ca

1 file changed

Lines changed: 20 additions & 6 deletions

File tree

lib/test/TestSuite.js

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -824,17 +824,31 @@ class TestSuite {
824824
const isTheTestExcluded = tags.some(tag => exclude.includes(tag))
825825
|| suiteTags.some(suiteTag => exclude.includes(suiteTag));
826826

827-
if (isTheTestIncluded) {
828-
test.only = true;
829-
} else {
830-
test.skip = true;
831-
}
832-
833827
if (isTheTestExcluded) {
834828
test.skip = true;
829+
} else {
830+
test.isTheTestIncluded = isTheTestIncluded;
835831
}
832+
return test;
833+
});
836834

835+
const hasSomeTestIncludeAndOnly = this.tests.some(test => test.only && test.isTheTestIncluded);
836+
this.tests = this.tests.map((test) => {
837+
if (hasSomeTestIncludeAndOnly) {
838+
if (test.isTheTestIncluded && test.only) {
839+
test.only = true;
840+
} else {
841+
test.skip = true;
842+
}
843+
} else {
844+
if (test.isTheTestIncluded) {
845+
test.only = true;
846+
} else {
847+
test.skip = true;
848+
}
849+
}
837850
return test;
851+
838852
});
839853
}
840854

0 commit comments

Comments
 (0)