Skip to content

Commit 3f5b373

Browse files
committed
test: pool options still have credentials set
1 parent 1195d3b commit 3f5b373

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

test/integration/connection-monitoring-and-pooling/connection_monitoring_and_pooling.test.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { expect } from 'chai';
22
import { once } from 'events';
33

4-
import { MongoClient } from '../../../src';
4+
import { MongoClient, MongoCredentials } from '../../../src';
55
import { loadSpecTests } from '../../spec';
66
import { CmapTest, runCmapTestSuite } from '../../tools/cmap_spec_runner';
77

@@ -39,6 +39,18 @@ describe('Connection Monitoring and Pooling (Node Driver)', function () {
3939
await client.connect();
4040
const [event] = await poolCreated;
4141
expect(event).to.have.deep.nested.property('options.credentials', {});
42+
43+
const poolOptions = Array.from(client.topology?.s.servers.values() ?? []).map(
44+
s => s.s.pool.options
45+
);
46+
expect(poolOptions).to.have.length.of.at.least(1);
47+
48+
for (const { credentials = {} } of poolOptions) {
49+
expect(
50+
Object.keys(credentials),
51+
'pool.options.credentials must exist and have keys'
52+
).to.not.equal(0);
53+
}
4254
}
4355
});
4456

0 commit comments

Comments
 (0)