Skip to content

Commit fc79abd

Browse files
committed
Fix
1 parent 1e50280 commit fc79abd

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

build.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,16 +91,20 @@ function buildTestSuite(testsFolder, tags, all, exclude) {
9191
? list => tags.every(t => list.includes(t))
9292
: list => tags.some(t => list.includes(t))
9393
const tests = readTestsFromDir(testsFolder)
94-
.filter(test => tags.length === 0 || (!tagFilter('tags' in test ? test.tags : []) !== !exclude));
94+
.filter(test => tags.length === 0 || (tagFilter(getTags(test)) !== exclude));
9595
tests.forEach(test => {
9696
if ('tags' in test) test.tags.sort();
9797
});
9898
const cts = {'description': description, 'tests': tests};
9999
console.log(JSON.stringify(cts, null, jsonIndent));
100-
const allTags = Array.from(new Set(tests.flatMap(test => 'tags' in test ? test.tags : [])));
100+
const allTags = Array.from(new Set(tests.flatMap(getTags)));
101101
allTags.sort();
102102
console.error(`Wrote ${tests.length} tests to stdout.`);
103103
console.error(`Tags (${allTags.length}): ${allTags.join(', ')}`);
104+
105+
function getTags(test) {
106+
return 'tags' in test ? test.tags : [];
107+
}
104108
}
105109

106110
/**

0 commit comments

Comments
 (0)