(config)
| 74 | } |
| 75 | |
| 76 | setup(config) { |
| 77 | const options = {}; |
| 78 | if (this.requiresCSFLE) { |
| 79 | options.promoteValues = false; |
| 80 | options.promoteLongs = false; |
| 81 | } |
| 82 | this.sharedClient = config.newClient( |
| 83 | resolveConnectionString(config, { useMultipleMongoses: true }, this), |
| 84 | options |
| 85 | ); |
| 86 | if (config.topologyType === 'Sharded') { |
| 87 | this.failPointClients = config.options.hostAddresses.map(proxy => { |
| 88 | const authString = |
| 89 | process.env.AUTH === 'auth' |
| 90 | ? `${extractAuthFromConnectionString(process.env.MONGODB_URI)}@` |
| 91 | : ''; |
| 92 | return config.newClient( |
| 93 | `mongodb://${authString}${proxy.host}:${proxy.port}/${ |
| 94 | process.env.AUTH === 'auth' ? '?authSource=admin' : '' |
| 95 | }` |
| 96 | ); |
| 97 | }); |
| 98 | } |
| 99 | |
| 100 | return this.runForAllClients(client => client.connect()); |
| 101 | } |
| 102 | |
| 103 | async teardown() { |
| 104 | await this.runForAllClients(client => client.close()); |
nothing calls this directly
no test coverage detected