Skip to content

Commit 4e7d05d

Browse files
fix failing integration tests
1 parent c238206 commit 4e7d05d

File tree

1 file changed

+18
-42
lines changed

1 file changed

+18
-42
lines changed

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

Lines changed: 18 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -335,52 +335,28 @@ describe('class MongoClient', function () {
335335
});
336336
});
337337

338-
it('Should correctly pass through appname', {
339-
metadata: {
340-
requires: {
341-
topology: ['single', 'replicaset', 'sharded']
342-
}
343-
},
344-
345-
test: function (done) {
346-
const configuration = this.configuration;
347-
const options = {
348-
appName: 'hello world'
349-
};
350-
const client = configuration.newClient(options);
351-
352-
client.connect(function (err, client) {
353-
expect(err).to.not.exist;
354-
expect(client)
355-
.to.have.nested.property('topology.clientMetadata.application.name')
356-
.to.equal('hello world');
338+
it('Should correctly pass through appname', async function () {
339+
const configuration = this.configuration;
340+
const options = {
341+
appName: 'hello world'
342+
};
343+
const client = configuration.newClient(options);
357344

358-
client.close(done);
359-
});
360-
}
345+
const {
346+
application: { name }
347+
} = await client.options.metadata;
348+
expect(name).to.equal('hello world');
361349
});
362350

363-
it('Should correctly pass through appname in options', {
364-
metadata: {
365-
requires: {
366-
topology: ['single', 'replicaset', 'sharded']
367-
}
368-
},
369-
370-
test: function (done) {
371-
const configuration = this.configuration;
372-
const url = configuration.url();
373-
374-
const client = configuration.newClient(url, { appname: 'hello world' });
375-
client.connect(err => {
376-
expect(err).to.not.exist;
377-
expect(client)
378-
.to.have.nested.property('topology.clientMetadata.application.name')
379-
.to.equal('hello world');
351+
it('Should correctly pass through appname in options', async function () {
352+
const configuration = this.configuration;
353+
const url = this.configuration.url();
354+
const client = configuration.newClient(url, { appName: 'hello world' });
380355

381-
client.close(done);
382-
});
383-
}
356+
const {
357+
application: { name }
358+
} = await client.options.metadata;
359+
expect(name).to.equal('hello world');
384360
});
385361

386362
it('Should correctly pass through socketTimeoutMS and connectTimeoutMS', {

0 commit comments

Comments
 (0)