diff --git a/test/functional/collection.test.js b/test/functional/collection.test.js index 1b91a99e42b..866917d7e76 100644 --- a/test/functional/collection.test.js +++ b/test/functional/collection.test.js @@ -5,6 +5,7 @@ const chai = require('chai'); const expect = chai.expect; const sinonChai = require('sinon-chai'); const mock = require('../tools/mongodb-mock/index'); + chai.use(sinonChai); describe('Collection', function () { diff --git a/test/tools/mongodb-mock/src/request.js b/test/tools/mongodb-mock/src/request.js index a63ffa4edfc..30b14404244 100644 --- a/test/tools/mongodb-mock/src/request.js +++ b/test/tools/mongodb-mock/src/request.js @@ -1,4 +1,5 @@ const BSON = require('bson'); + const { Long } = BSON; const { snappy } = require('./snappy_importer'); const zlib = require('zlib'); diff --git a/test/tools/mongodb-mock/src/wire_response.js b/test/tools/mongodb-mock/src/wire_response.js index 2ac8047a98a..264839c65be 100644 --- a/test/tools/mongodb-mock/src/wire_response.js +++ b/test/tools/mongodb-mock/src/wire_response.js @@ -1,4 +1,5 @@ const BSON = require('bson'); + const { Long } = BSON; // Response flags diff --git a/test/unit/polling_srv_records_for_mongos_discovery.prose.test.ts b/test/unit/polling_srv_records_for_mongos_discovery.prose.test.ts index 6aafbf474f7..e1eb517d4cb 100644 --- a/test/unit/polling_srv_records_for_mongos_discovery.prose.test.ts +++ b/test/unit/polling_srv_records_for_mongos_discovery.prose.test.ts @@ -3,8 +3,9 @@ import * as dns from 'dns'; import * as sinon from 'sinon'; import { MongoClient } from '../../src'; -import { processTick } from '../tools/utils'; import * as mock from '../tools/mongodb-mock/index'; +import type { MockServer } from '../tools/mongodb-mock/src/server'; +import { processTick } from '../tools/utils'; /* The SRV Prose Tests make use of the following REAL DNS records. @@ -26,7 +27,7 @@ import * as mock from '../tools/mongodb-mock/index'; const srvRecord = (name, port) => ({ name, port, weight: 0, priority: 0 }); interface ShardedClusterMocks { - mongoses: mock.MockServer[]; + mongoses: MockServer[]; readonly srvRecords: dns.SrvRecord[]; } diff --git a/test/unit/unit_snappy.test.js b/test/unit/unit_snappy.test.js index 001af32b6fe..06321bb60ab 100644 --- a/test/unit/unit_snappy.test.js +++ b/test/unit/unit_snappy.test.js @@ -2,6 +2,7 @@ const { expect } = require('chai'); const mock = require('../tools/mongodb-mock/index'); + const snappy = optionalRequire('snappy'); const snappyVersion = optionalRequire('snappy/package.json').version; const { MongoClient } = require('../../src');