@@ -368,71 +368,4 @@ describe('$lookup support', defaultMetadata, function () {
368
368
/ U p g r a d e / i,
369
369
{ requires : { ...defaultMetadata . requires , mongodb : '>=7.0.0 <8.1.0' } }
370
370
) ;
371
-
372
- describe ( 'Node.js custom test' , function ( ) {
373
- describe ( 'when enableMultipleCollinfo is off and a $lookup is run' , function ( ) {
374
- let client : MongoClient ;
375
-
376
- beforeEach ( async function ( ) {
377
- const mochaTest = { metadata : defaultMetadata } ;
378
-
379
- if ( ! this . configuration . filters . MongoDBVersionFilter . filter ( mochaTest ) ) {
380
- return ;
381
- }
382
-
383
- if ( ! this . configuration . filters . MongoDBTopologyFilter . filter ( mochaTest ) ) {
384
- return ;
385
- }
386
-
387
- if ( ! this . configuration . filters . ClientSideEncryptionFilter . filter ( mochaTest ) ) {
388
- return ;
389
- }
390
-
391
- const getMongoCrypt = sinon . stub ( AutoEncrypter , 'getMongoCrypt' ) . callsFake ( function ( ) {
392
- const MongoCrypt = getMongoCrypt . wrappedMethod . call ( this ) ;
393
- return class extends MongoCrypt {
394
- constructor ( options : MongoCryptOptions ) {
395
- expect ( options ) . to . have . property ( 'enableMultipleCollinfo' , true ) ; // assert invariant
396
- options . enableMultipleCollinfo = false ;
397
- super ( options ) ;
398
- }
399
- } ;
400
- } ) ;
401
-
402
- client = newEncryptedClient ( this ) ;
403
- } ) ;
404
-
405
- afterEach ( async function ( ) {
406
- sinon . restore ( ) ;
407
- await client ?. close ( ) ;
408
- } ) ;
409
-
410
- it (
411
- 'throws a TypeError about libmongocrypt not enabled to support multiple collections' ,
412
- defaultMetadata ,
413
- async ( ) => {
414
- const collection = client . db ( 'db' ) . collection ( 'csfle' ) ;
415
- const actual = await collection
416
- . aggregate ( [
417
- { $match : { csfle : 'csfle' } } ,
418
- {
419
- $lookup : {
420
- from : 'csfle2' ,
421
- as : 'matched' ,
422
- pipeline : [ { $match : { csfle2 : 'csfle2' } } , { $project : { _id : 0 } } ]
423
- }
424
- } ,
425
- { $project : { _id : 0 } }
426
- ] )
427
- . toArray ( )
428
- . catch ( error => error ) ;
429
-
430
- expect ( actual ) . to . be . instanceOf ( MongoCryptError ) ;
431
- expect ( actual . message ) . to . match (
432
- / l i b m o n g o c r y p t i s n o t c o n f i g u r e d t o s u p p o r t e n c r y p t i n g a c o m m a n d w i t h m u l t i p l e c o l l e c t i o n s / i
433
- ) ;
434
- }
435
- ) ;
436
- } ) ;
437
- } ) ;
438
371
} ) ;
0 commit comments