Skip to content

Commit 2cbd267

Browse files
committed
test(NODE-7182): migrate integration/connection-monitoring-and-pooling tests
1 parent 4ab2632 commit 2cbd267

File tree

1 file changed

+7
-18
lines changed

1 file changed

+7
-18
lines changed

test/integration/connection-monitoring-and-pooling/connection.test.ts

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
import { type EventEmitter, once } from 'node:events';
2+
import { setTimeout } from 'node:timers';
3+
14
import { expect } from 'chai';
2-
import { type EventEmitter, once } from 'events';
35
import * as sinon from 'sinon';
4-
import { setTimeout } from 'timers';
56

67
import {
78
addContainerMetadata,
@@ -173,7 +174,7 @@ describe('Connection', function () {
173174
metadata: {
174175
requires: { topology: 'single', os: '!win32' }
175176
},
176-
test: function (done) {
177+
test: async function () {
177178
const configuration = this.configuration;
178179
const uri = `mongodb://${encodeURIComponent('/tmp/mongodb-27017.sock')}?w=1`;
179180
const options: MongoClientOptions = {
@@ -186,22 +187,10 @@ describe('Connection', function () {
186187

187188
const db = client.db(configuration.db);
188189

189-
db.collection('domainSocketCollection0').insert(
190-
{ a: 1 },
191-
{ writeConcern: { w: 1 } },
192-
function (err) {
193-
expect(err).to.not.exist;
194-
195-
db.collection('domainSocketCollection0')
196-
.find({ a: 1 })
197-
.toArray(function (err, items) {
198-
expect(err).to.not.exist;
199-
test.equal(1, items.length);
190+
await db.collection('domainSocketCollection0').insert({ a: 1 }, { writeConcern: { w: 1 } });
200191

201-
done();
202-
});
203-
}
204-
);
192+
const items = await db.collection('domainSocketCollection0').find({ a: 1 }).toArray();
193+
test.equal(1, items.length);
205194
}
206195
});
207196

0 commit comments

Comments
 (0)