Skip to content

Commit e6b9007

Browse files
W-A-Jamesnbbeeken
authored andcommitted
update utils to properly construct topology
1 parent c25e4d7 commit e6b9007

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

test/tools/utils.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import {
1414
type Document,
1515
type HostAddress,
1616
MongoClient,
17+
type MongoOptions,
1718
OP_MSG,
1819
Topology,
1920
type TopologyOptions
@@ -500,13 +501,12 @@ export const sorted = <T>(iterable: Iterable<T>, how: (a: T, b: T) => 0 | 1 | -1
500501
* changes*/
501502
export function topologyWithPlaceholderClient(
502503
seeds: string | string[] | HostAddress | HostAddress[],
503-
options: Partial<TopologyOptions>
504+
options: Partial<MongoOptions>
504505
): Topology {
505-
return new Topology(
506-
new MongoClient('mongodb://iLoveJavaScript'),
507-
seeds,
508-
options as TopologyOptions
509-
);
506+
return new Topology(new MongoClient('mongodb://iLoveJavaScript'), {
507+
...options,
508+
hosts: seeds
509+
} as MongoOptions);
510510
}
511511

512512
export async function itInNodeProcess(

0 commit comments

Comments
 (0)