Skip to content

Commit f347313

Browse files
committed
test: refactor logic for unified topology filter
1 parent 4075b44 commit f347313

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

test/runner/filters/unified_filter.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,13 @@
1212
*/
1313
class UnifiedTopologyFilter {
1414
filter(test) {
15-
if (!test.metadata) return true;
16-
if (!test.metadata.requires) return true;
17-
if (typeof test.metadata.requires.unifiedTopology !== 'boolean') return true;
15+
const unifiedTopology =
16+
test.metadata && test.metadata.requires && test.metadata.requires.unifiedTopology;
1817

19-
const requireUnifiedTopology = !!test.metadata.requires.unifiedTopology;
20-
return requireUnifiedTopology === !!process.env.MONGODB_UNIFIED_TOPOLOGY;
18+
return (
19+
typeof unifiedTopology !== 'boolean' ||
20+
unifiedTopology === process.env.MONGODB_UNIFIED_TOPOLOGY
21+
);
2122
}
2223
}
2324

0 commit comments

Comments
 (0)