Skip to content

Commit 1700631

Browse files
fix?
1 parent b72ba10 commit 1700631

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

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

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import {
1414
makeClientMetadata,
1515
MongoClient,
1616
MongoClientAuthProviders,
17+
type MongoClientOptions,
1718
MongoDBResponse,
1819
MongoServerError,
1920
ns,
@@ -172,16 +173,16 @@ describe('Connection', function () {
172173
metadata: {
173174
requires: { topology: 'single', os: '!win32' }
174175
},
175-
176176
test: function (done) {
177177
const configuration = this.configuration;
178-
client = configuration.newClient(
179-
`mongodb://${encodeURIComponent('/tmp/mongodb-27017.sock')}?w=1`,
180-
{
181-
maxPoolSize: 1,
182-
auth: { ...this.configuration.options.auth }
183-
}
184-
);
178+
const uri = `mongodb://${encodeURIComponent('/tmp/mongodb-27017.sock')}?w=1`;
179+
const options: MongoClientOptions = {
180+
maxPoolSize: 1
181+
};
182+
if (this.configuration.options.auth) {
183+
options.auth = this.configuration.options.auth;
184+
}
185+
client = configuration.newClient(uri, options);
185186

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

0 commit comments

Comments
 (0)