MCPcopy
hub / github.com/mongodb/node-mongodb-native / setup

Function setup

test/integration/sessions/sessions.test.ts:21–38  ·  test/integration/sessions/sessions.test.ts::setup
(config)

Source from the content-addressed store, hash-verified

19 client: null,
20 commands: { started: [], succeeded: [] },
21 async setup(config) {
22 this.commands = { started: [], succeeded: [] };
23 this.client = config.newClient({ w: 1 }, { maxPoolSize: 1, monitorCommands: true });
24
25 this.client.on(class="st">'commandStarted', event => {
26 if (ignoredCommands.indexOf(event.commandName) === -1) {
27 this.commands.started.push(event);
28 }
29 });
30
31 this.client.on(class="st">'commandSucceeded', event => {
32 if (ignoredCommands.indexOf(event.commandName) === -1) {
33 this.commands.succeeded.push(event);
34 }
35 });
36
37 await this.client.connect();
38 }
39};
40
41describe(class="st">'Sessions Spec', function () {

Callers

nothing calls this directly

Calls 4

onMethod · 0.80
newClientMethod · 0.45
pushMethod · 0.45
connectMethod · 0.45

Tested by

no test coverage detected