Skip to content

Commit

Permalink
test: pool options still have credentials set
Browse files Browse the repository at this point in the history
  • Loading branch information
nbbeeken committed Aug 15, 2023
1 parent 1195d3b commit 3f5b373
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { expect } from 'chai';
import { once } from 'events';

import { MongoClient } from '../../../src';
import { MongoClient, MongoCredentials } from '../../../src';
import { loadSpecTests } from '../../spec';
import { CmapTest, runCmapTestSuite } from '../../tools/cmap_spec_runner';

Expand Down Expand Up @@ -39,6 +39,18 @@ describe('Connection Monitoring and Pooling (Node Driver)', function () {
await client.connect();
const [event] = await poolCreated;
expect(event).to.have.deep.nested.property('options.credentials', {});

const poolOptions = Array.from(client.topology?.s.servers.values() ?? []).map(
s => s.s.pool.options
);
expect(poolOptions).to.have.length.of.at.least(1);

for (const { credentials = {} } of poolOptions) {
expect(
Object.keys(credentials),
'pool.options.credentials must exist and have keys'
).to.not.equal(0);
}
}
});

Expand Down

0 comments on commit 3f5b373

Please sign in to comment.