Skip to content

Commit b1e2d42

Browse files
fixed unit tests
1 parent 4cab947 commit b1e2d42

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

src/mongo_types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ export class TypedEventEmitter<Events extends EventsDescription> extends EventEm
410410
...args: Parameters<Events[EventKey]>
411411
): void {
412412
this.emit(event, ...args);
413-
if (this.component) this.mongoLogger?.debug?.(this.component, args[0]);
413+
if (this.component) this.mongoLogger?.debug(this.component, args[0]);
414414
}
415415
}
416416

test/unit/sdam/monitor.test.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,16 @@ class MockServer {
2525
this.pool = { generation: 1 };
2626
this.description = new ServerDescription(`${options.host}:${options.port}`);
2727
this.description.type = ServerType.Unknown;
28-
this.topology = { s: { topologyId: 1 }, client: { mongoLogger: {} } };
28+
this.topology = {
29+
s: { topologyId: 1 },
30+
client: {
31+
mongoLogger: {
32+
debug: function (_v: any, _x: any) {
33+
return;
34+
}
35+
}
36+
}
37+
};
2938
}
3039
}
3140

0 commit comments

Comments
 (0)