@@ -129,13 +129,14 @@ function generateTopologyTests(testSuites, testContext, filter) {
129
129
environmentRequirementList . forEach ( requires => {
130
130
const suiteName = `${ testSuite . name } - ${ requires . topology . join ( ) } ` ;
131
131
describe ( suiteName , {
132
- // FIXME: calling this.skip() inside tests triggers the leak checker, disable until fixed
133
- metadata : { requires, sessions : { skipLeakTests : true } } ,
132
+ metadata : { requires } ,
134
133
test : function ( ) {
135
134
beforeEach ( ( ) => prepareDatabaseForSuite ( testSuite , testContext ) ) ;
136
135
afterEach ( ( ) => testContext . cleanupAfterSuite ( ) ) ;
137
136
testSuite . tests . forEach ( spec => {
138
- const maybeIt = shouldRunSpecTest . call ( this , requires , spec , filter ) ? it : it . skip ;
137
+ const maybeIt = shouldRunSpecTest ( this . configuration , requires , spec , filter )
138
+ ? it
139
+ : it . skip ;
139
140
maybeIt ( spec . description , function ( ) {
140
141
let testPromise = Promise . resolve ( ) ;
141
142
if ( spec . failPoint ) {
@@ -159,9 +160,9 @@ function generateTopologyTests(testSuites, testContext, filter) {
159
160
} ) ;
160
161
}
161
162
162
- function shouldRunSpecTest ( requires , spec , filter ) {
163
+ function shouldRunSpecTest ( configuration , requires , spec , filter ) {
163
164
if ( requires . authEnabled && process . env . AUTH !== 'auth' ) {
164
- // TODO: We do not have a way to determine if auth is enabled in our mocha metadata
165
+ // TODO(NODE-3488) : We do not have a way to determine if auth is enabled in our mocha metadata
165
166
// We need to do a admin.command({getCmdLineOpts: 1}) if it errors (code=13) auth is on
166
167
return false ;
167
168
}
@@ -175,10 +176,7 @@ function shouldRunSpecTest(requires, spec, filter) {
175
176
return false ;
176
177
}
177
178
178
- if (
179
- spec . skipReason ||
180
- ( filter && typeof filter === 'function' && ! filter ( spec , this . configuration ) )
181
- ) {
179
+ if ( spec . skipReason || ( filter && typeof filter === 'function' && ! filter ( spec , configuration ) ) ) {
182
180
return false ;
183
181
}
184
182
return true ;
0 commit comments