@@ -761,28 +761,27 @@ describe('ReadPreference', function() {
761
761
} ) ;
762
762
763
763
it ( 'should use session readPreference instead of client readPreference' , {
764
- metadata : { requires : { topology : [ 'single' , 'replicaset' ] } } ,
764
+ metadata : { requires : { unifiedTopology : true , topology : [ 'single' , 'replicaset' ] } } ,
765
765
test : function ( done ) {
766
766
const configuration = this . configuration ;
767
767
const client = this . configuration . newClient ( configuration . writeConcernMax ( ) , {
768
- useUnifiedTopology : true ,
769
768
readPreference : 'primaryPreferred'
770
769
} ) ;
771
770
772
771
client . connect ( ( err , client ) => {
773
772
this . defer ( ( ) => {
774
773
client . close ( ) ;
775
774
} ) ;
776
- expect ( err ) . to . be . null ;
777
- expect ( client ) . to . not . be . null ;
775
+ expect ( err ) . to . not . exist ;
776
+ expect ( client ) . to . exist ;
778
777
const session = client . startSession ( {
779
778
defaultTransactionOptions : { readPreference : 'secondary' } ,
780
779
causalConsistency : true
781
780
} ) ;
782
781
783
782
session . startTransaction ( ) ;
784
783
const result = ReadPreference . resolve ( client , { session : session } ) ;
785
- expect ( result ) . to . not . be . undefined ;
784
+ expect ( result ) . to . exist ;
786
785
expect ( result . mode ) . to . deep . equal ( 'secondary' ) ;
787
786
session . abortTransaction ( ) ;
788
787
0 commit comments