@@ -640,31 +640,29 @@ describe('Aggregation', function () {
640640 expect ( error ) . to . be . instanceOf ( MongoInvalidArgumentError ) ;
641641 } ) ;
642642
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 ( ) {
644644 const db = client . db ( ) ;
645645
646646 const collection = db . collection ( 'foo' ) ;
647647 Object . assign ( collection . s , { writeConcern : { j : true } } ) ;
648- const error = await collection
648+ const result = await collection
649649 . aggregate ( [ { $project : { _id : 0 } } , { $out : 'bar' } ] , { explain : true } )
650- . toArray ( )
651- . catch ( error => error ) ;
650+ . toArray ( ) ;
652651
653- expect ( error ) . to . be . instanceOf ( MongoInvalidArgumentError ) ;
652+ expect ( result ) . to . not . be . null ;
654653 } ) ;
655654
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 ( ) {
657656 const db = client . db ( ) ;
658657
659658 const collection = db . collection ( 'foo' ) ;
660659 Object . assign ( collection . s , { writeConcern : { j : true } } ) ;
661660
662- const error = await collection
661+ const result = await collection
663662 . aggregate ( [ { $project : { _id : 0 } } , { $out : 'bar' } ] , { explain : true } )
664- . toArray ( )
665- . catch ( error => error ) ;
663+ . toArray ( ) ;
666664
667- expect ( error ) . to . be . instanceOf ( MongoInvalidArgumentError ) ;
665+ expect ( result ) . to . not . be . null ;
668666 } ) ;
669667
670668 it ( 'should ensure MaxTimeMS is correctly passed down into command execution when using a cursor' , function ( done ) {
0 commit comments