Skip to content

Commit 19ebaf0

Browse files
fix failing server API tests
1 parent faec64a commit 19ebaf0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/tools/runner/config.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ export class TestConfiguration {
8383
auth?: { username: string; password: string; authSource?: string };
8484
proxyURIParams?: ProxyParams;
8585
};
86-
serverApi: ServerApi;
86+
serverApi?: ServerApi;
8787
activeResources: number;
8888
isSrv: boolean;
8989
serverlessCredentials: { username: string | undefined; password: string | undefined };
@@ -176,7 +176,7 @@ export class TestConfiguration {
176176
* Returns a `hello`, executed against `uri`.
177177
*/
178178
async hello(uri = this.uri) {
179-
const client = new MongoClient(uri);
179+
const client = this.newClient(uri);
180180
try {
181181
await client.connect();
182182
const { maxBsonObjectSize, maxMessageSizeBytes, maxWriteBatchSize, ...rest } = await client
@@ -199,7 +199,7 @@ export class TestConfiguration {
199199
}
200200

201201
newClient(urlOrQueryOptions?: string | Record<string, any>, serverOptions?: MongoClientOptions) {
202-
serverOptions = Object.assign({}, getEnvironmentalOptions(), serverOptions);
202+
serverOptions = Object.assign(<MongoClientOptions>{}, getEnvironmentalOptions(), serverOptions);
203203

204204
// Support MongoClient constructor form (url, options) for `newClient`.
205205
if (typeof urlOrQueryOptions === 'string') {

0 commit comments

Comments
 (0)