@@ -640,31 +640,29 @@ describe('Aggregation', function () {
640
640
expect ( error ) . to . be . instanceOf ( MongoInvalidArgumentError ) ;
641
641
} ) ;
642
642
643
- it ( `should fail if you try to use explain flag with { readConcern: { level: 'local' }, writeConcern: { j: true } }` , async function ( ) {
643
+ it ( `should succeed if you try to use explain flag with { readConcern: { level: 'local' }, writeConcern: { j: true } }` , async function ( ) {
644
644
const db = client . db ( ) ;
645
645
646
646
const collection = db . collection ( 'foo' ) ;
647
647
Object . assign ( collection . s , { writeConcern : { j : true } } ) ;
648
- const error = await collection
648
+ const result = await collection
649
649
. aggregate ( [ { $project : { _id : 0 } } , { $out : 'bar' } ] , { explain : true } )
650
- . toArray ( )
651
- . catch ( error => error ) ;
650
+ . toArray ( ) ;
652
651
653
- expect ( error ) . to . be . instanceOf ( MongoInvalidArgumentError ) ;
652
+ expect ( result ) . to . not . be . null ;
654
653
} ) ;
655
654
656
- it ( 'should fail if you try to use explain flag with { writeConcern: { j: true } }' , async function ( ) {
655
+ it ( 'should succeed if you try to use explain flag with { writeConcern: { j: true } }' , async function ( ) {
657
656
const db = client . db ( ) ;
658
657
659
658
const collection = db . collection ( 'foo' ) ;
660
659
Object . assign ( collection . s , { writeConcern : { j : true } } ) ;
661
660
662
- const error = await collection
661
+ const result = await collection
663
662
. aggregate ( [ { $project : { _id : 0 } } , { $out : 'bar' } ] , { explain : true } )
664
- . toArray ( )
665
- . catch ( error => error ) ;
663
+ . toArray ( ) ;
666
664
667
- expect ( error ) . to . be . instanceOf ( MongoInvalidArgumentError ) ;
665
+ expect ( result ) . to . not . be . null ;
668
666
} ) ;
669
667
670
668
it ( 'should ensure MaxTimeMS is correctly passed down into command execution when using a cursor' , function ( done ) {
0 commit comments