(connectionString, clientOptions)
| 297 | }); |
| 298 | |
| 299 | async function testConnection(connectionString, clientOptions) { |
| 300 | const client = new MongoClient(connectionString, clientOptions); |
| 301 | let topologyType; |
| 302 | client.on('topologyDescriptionChanged', ev => (topologyType = ev.newDescription.type)); |
| 303 | |
| 304 | try { |
| 305 | await client.connect(); |
| 306 | await client.db('admin').command({ hello: 1 }); |
| 307 | await client.db('test').collection('test').findOne({}); |
| 308 | } finally { |
| 309 | await client.close(); |
| 310 | } |
| 311 | return topologyType; |
| 312 | } |
no test coverage detected