File tree Expand file tree Collapse file tree
test/tools/unified-spec-runner Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -143,17 +143,29 @@ async function runUnifiedTest(
143143 trace ( 'initialData' ) ;
144144 for ( const { databaseName, collectionName } of unifiedSuite . initialData ) {
145145 const db = utilClient . db ( databaseName ) ;
146- const collection = db . collection ( collectionName , {
147- writeConcern : { w : 'majority' }
148- } ) ;
149146
150- trace ( 'drop' ) ;
151- expect (
152- await collection . drop ( {
153- // Specifying any encrypted fields causes `collection.drop()` to drop the esoc and esc collections as well.
154- encryptedFields : { }
155- } )
156- ) . to . be . true ;
147+ trace ( 'listCollections' ) ;
148+ const allCollections = new Set (
149+ await db
150+ . listCollections ( )
151+ . map ( ( { name } ) => name )
152+ . toArray ( )
153+ ) ;
154+
155+ const collections = [
156+ collectionName ,
157+ `enxcol_.${ collectionName } .esc` ,
158+ `enxcol_.${ collectionName } .ecoc`
159+ ] . filter ( allCollections . has . bind ( allCollections ) ) ;
160+
161+ for ( const name of collections ) {
162+ const collection = db . collection ( name , {
163+ writeConcern : { w : 'majority' }
164+ } ) ;
165+
166+ trace ( 'drop' ) ;
167+ expect ( await collection . drop ( ) ) . to . be . true ;
168+ }
157169 }
158170
159171 for ( const {
You can’t perform that action at this time.
0 commit comments