Skip to content

Commit b9699de

Browse files
committed
test: add unit test
1 parent cbcfac2 commit b9699de

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

test/unit/bindings.test.ts

+18
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,24 @@ describe('MongoCryptConstructor', () => {
9797
});
9898
});
9999

100+
describe('options.keyExpirationMS', () => {
101+
context('when the number is positive', () => {
102+
it('does not error', () => {
103+
expect(
104+
new MongoCrypt({ kmsProviders: serialize({ aws: {} }), keyExpirationMS: 1000000 })
105+
).to.be.instanceOf(MongoCrypt);
106+
});
107+
});
108+
109+
context('when the number is negative', () => {
110+
it('throws an error', () => {
111+
expect(() => {
112+
new MongoCrypt({ kmsProviders: serialize({ aws: {} }), keyExpirationMS: -1000000 });
113+
}).to.throw(TypeError);
114+
});
115+
});
116+
});
117+
100118
describe('options.encryptedFieldsMap', () => {
101119
it('throws when provided and not a Uint8Array', () => {
102120
expect(

0 commit comments

Comments
 (0)