Skip to content

Commit af14ffe

Browse files
committed
test(NODE-3924): add test to throw on non-string values
1 parent a67d3a1 commit af14ffe

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

test/unit/mongo_client.test.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,28 @@ describe('MongoOptions', function () {
6464
expect(options).has.property('tls', true);
6565
});
6666

67+
context('tlsCAFile', function () {
68+
it('throws MongoParseError when passed a URL Object', function () {
69+
it('throws MongoParseError when passed a URL Object', function () {
70+
expect(
71+
() =>
72+
new MongoClient('mongodb://localhost:27017', {
73+
tlsCAFile: new URL('file://hello')
74+
})
75+
).to.throw(MongoParseError);
76+
});
77+
});
78+
});
79+
context('tlsCertificateKeyFile', function () {
80+
it('throws MongoParseError when passed a URL Object', function () {
81+
expect(
82+
() =>
83+
new MongoClient('mongodb://localhost:27017', {
84+
tlsCertificateKeyFile: new URL('file://hello')
85+
})
86+
).to.throw(MongoParseError);
87+
});
88+
});
6789
const ALL_OPTIONS = {
6890
appName: 'cats',
6991
auth: { username: 'username', password: 'password' },

0 commit comments

Comments
 (0)