Skip to content

Commit cad85bc

Browse files
committed
fix find test bug
1 parent fc56c5f commit cad85bc

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

test/functional/find.test.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2637,15 +2637,16 @@ describe('Find', function () {
26372637
expect(err).to.not.exist;
26382638

26392639
let selectedServer;
2640-
const selectServerStub = sinon.stub(client.topology, 'selectServer').callsFake(function () {
2640+
const topology = client.topology;
2641+
const selectServerStub = sinon.stub(topology, 'selectServer').callsFake(function () {
26412642
const args = Array.prototype.slice.call(arguments);
26422643
const originalCallback = args.pop();
26432644
args.push((err, server) => {
26442645
selectedServer = server;
26452646
originalCallback(err, server);
26462647
});
26472648

2648-
return client.topology.selectServer.wrappedMethod.apply(this, args);
2649+
return topology.selectServer.wrappedMethod.apply(this, args);
26492650
});
26502651

26512652
const collection = client.db().collection('test_read_preference');

0 commit comments

Comments
 (0)