Skip to content

Commit b44db82

Browse files
committed
test: fix noauth test
1 parent 976f4a5 commit b44db82

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

test/integration/node-specific/mongo_client.test.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import {
1818
ServerDescription,
1919
Topology
2020
} from '../../mongodb';
21-
import { clearFailPoint, configureFailPoint, runLater } from '../../tools/utils';
21+
import { clearFailPoint, configureFailPoint } from '../../tools/utils';
2222
import { setupDatabase } from '../shared';
2323

2424
describe('class MongoClient', function () {
@@ -603,10 +603,12 @@ describe('class MongoClient', function () {
603603
'does not checkout connection when authentication is disabled',
604604
{ requires: { auth: 'disabled' } },
605605
async function () {
606-
const checkoutStarted = once(client, 'connectionCheckOutStarted');
606+
const checkoutStartedEvents = [];
607+
client.on('connectionCheckOutStarted', event => {
608+
checkoutStartedEvents.push(event);
609+
});
607610
await client.connect();
608-
const checkout = await checkoutStarted;
609-
expect(checkout).to.not.exist;
611+
expect(checkoutStartedEvents).to.be.empty;
610612
expect(client).to.have.property('topology').that.is.instanceOf(Topology);
611613
}
612614
);

0 commit comments

Comments
 (0)