Skip to content

Commit fcf1dea

Browse files
fix topology test
1 parent 05c5951 commit fcf1dea

File tree

1 file changed

+9
-14
lines changed

1 file changed

+9
-14
lines changed

test/unit/sdam/topology.test.js

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ describe('Topology (unit)', function () {
4646
done();
4747
});
4848

49-
it('should report the correct platform in client metadata', function (done) {
49+
it('should report the correct platform in client metadata', async function () {
5050
const helloRequests = [];
5151
mockServer.setMessageHandler(request => {
5252
const doc = request.document;
@@ -59,22 +59,17 @@ describe('Topology (unit)', function () {
5959
});
6060

6161
client = new MongoClient(`mongodb://${mockServer.uri()}/`);
62-
client.connect(err => {
63-
expect(err).to.not.exist;
6462

65-
client.db().command({ ping: 1 }, err => {
66-
expect(err).to.not.exist;
63+
await client.connect();
6764

68-
expect(helloRequests).to.have.length.greaterThan(1);
69-
helloRequests.forEach(helloRequest =>
70-
expect(helloRequest)
71-
.nested.property('client.platform')
72-
.to.match(/unified/)
73-
);
65+
await client.db().command({ ping: 1 });
7466

75-
done();
76-
});
77-
});
67+
expect(helloRequests).to.have.length.greaterThan(1);
68+
for (const request of helloRequests) {
69+
expect(request)
70+
.nested.property('client.platform')
71+
.to.match(/Node.js /);
72+
}
7873
});
7974
});
8075

0 commit comments

Comments
 (0)