Skip to content

Commit e97cc3c

Browse files
srv test
1 parent 3338fb9 commit e97cc3c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
/* eslint-disable @typescript-eslint/no-empty-function */
2+
import { MongoClient } from 'mongodb-legacy';
23
import { type TestConfiguration } from '../../tools/runner/config';
34
import { runScriptAndGetProcessInfo } from './resource_tracking_script_builder';
5+
import { expect } from 'chai';
46

57
describe.only('MongoClient.close() Integration', () => {
68
// note: these tests are set-up in accordance of the resource ownership tree
@@ -428,13 +430,13 @@ describe.only('MongoClient.close() Integration', () => {
428430

429431
describe('after SRVPoller is created', () => {
430432
it.only('timers are cleaned up by client.close()', metadata, async () => {
431-
const run = async function ({ MongoClient, uri, expect, sinon, getTimerCount }) {
433+
const run = async function ({ MongoClient, uri, expect, getTimerCount }) {
432434
const client = new MongoClient(uri);
433435
await client.connect();
434436
const description = client.topology.s.description;
435437
// simulate transition to sharded
436-
client.topology.emit('topologyDescriptionChanged', description, { ... description, type: 'Sharded'});
437-
expect(client.topology.s.srvPoller?._timeout).to.exist;
438+
client.topology.emit('topologyDescriptionChanged', description, { ... description, type: 'Sharded'});
439+
expect(client.topology.s.srvPoller._timeout).to.exist;
438440
await client.close();
439441
expect(getTimerCount()).to.equal(0);
440442
};

0 commit comments

Comments
 (0)