Skip to content

Commit 5b30ede

Browse files
committed
allow filtering of tests in statsCases
1 parent 1ad71e0 commit 5b30ede

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

test/StatsTestCases.test.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,16 @@ const tests = fs
1515
testName =>
1616
fs.existsSync(path.join(base, testName, "index.js")) ||
1717
fs.existsSync(path.join(base, testName, "webpack.config.js"))
18-
);
18+
)
19+
.filter(testName => {
20+
const testDirectory = path.join(base, testName);
21+
const filterPath = path.join(testDirectory, "test.filter.js");
22+
if (fs.existsSync(filterPath) && !require(filterPath)()) {
23+
describe.skip(testName, () => it("filtered"));
24+
return false;
25+
}
26+
return true;
27+
});
1928

2029
describe("StatsTestCases", () => {
2130
tests.forEach(testName => {

0 commit comments

Comments
 (0)