Skip to content

Commit 89dda16

Browse files
committed
test: test cleanup
1 parent 065c596 commit 89dda16

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

test/functional/readpreference.test.js

+4-5
Original file line numberDiff line numberDiff line change
@@ -761,28 +761,27 @@ describe('ReadPreference', function() {
761761
});
762762

763763
it('should use session readPreference instead of client readPreference', {
764-
metadata: { requires: { topology: ['single', 'replicaset'] } },
764+
metadata: { requires: { unifiedTopology: true, topology: ['single', 'replicaset'] } },
765765
test: function(done) {
766766
const configuration = this.configuration;
767767
const client = this.configuration.newClient(configuration.writeConcernMax(), {
768-
useUnifiedTopology: true,
769768
readPreference: 'primaryPreferred'
770769
});
771770

772771
client.connect((err, client) => {
773772
this.defer(() => {
774773
client.close();
775774
});
776-
expect(err).to.be.null;
777-
expect(client).to.not.be.null;
775+
expect(err).to.not.exist;
776+
expect(client).to.exist;
778777
const session = client.startSession({
779778
defaultTransactionOptions: { readPreference: 'secondary' },
780779
causalConsistency: true
781780
});
782781

783782
session.startTransaction();
784783
const result = ReadPreference.resolve(client, { session: session });
785-
expect(result).to.not.be.undefined;
784+
expect(result).to.exist;
786785
expect(result.mode).to.deep.equal('secondary');
787786
session.abortTransaction();
788787

0 commit comments

Comments
 (0)