From e97cc3c7d1626a17d151d29442ff603e7713893f Mon Sep 17 00:00:00 2001 From: Aditi Khare Date: Fri, 10 Jan 2025 13:17:09 -0500 Subject: [PATCH] srv test --- test/integration/node-specific/client_close.test.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/integration/node-specific/client_close.test.ts b/test/integration/node-specific/client_close.test.ts index 0e7f72d9fe..5089abc311 100644 --- a/test/integration/node-specific/client_close.test.ts +++ b/test/integration/node-specific/client_close.test.ts @@ -1,6 +1,8 @@ /* eslint-disable @typescript-eslint/no-empty-function */ +import { MongoClient } from 'mongodb-legacy'; import { type TestConfiguration } from '../../tools/runner/config'; import { runScriptAndGetProcessInfo } from './resource_tracking_script_builder'; +import { expect } from 'chai'; describe.only('MongoClient.close() Integration', () => { // note: these tests are set-up in accordance of the resource ownership tree @@ -428,13 +430,13 @@ describe.only('MongoClient.close() Integration', () => { describe('after SRVPoller is created', () => { it.only('timers are cleaned up by client.close()', metadata, async () => { - const run = async function ({ MongoClient, uri, expect, sinon, getTimerCount }) { + const run = async function ({ MongoClient, uri, expect, getTimerCount }) { const client = new MongoClient(uri); await client.connect(); const description = client.topology.s.description; // simulate transition to sharded - client.topology.emit('topologyDescriptionChanged', description, { ... description, type: 'Sharded'}); - expect(client.topology.s.srvPoller?._timeout).to.exist; + client.topology.emit('topologyDescriptionChanged', description, { ... description, type: 'Sharded'}); + expect(client.topology.s.srvPoller._timeout).to.exist; await client.close(); expect(getTimerCount()).to.equal(0); };