Skip to content

Commit 2af8e0e

Browse files
fix memory leak
1 parent 6232e2a commit 2af8e0e

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

test/bindings.test.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { expect } from 'chai';
2-
import { MongoCrypt, MongoCryptContextCtor } from '../src';
2+
import { MongoCrypt, MongoCryptContext, MongoCryptContextCtor } from '../src';
33
import { serialize, Binary, Long } from 'bson';
44
import * as crypto from 'crypto';
55

@@ -405,9 +405,12 @@ describe('MongoCryptConstructor', () => {
405405
});
406406

407407
describe('MongoCryptContext', () => {
408-
const context = new MongoCrypt({
409-
kmsProviders: serialize({ aws: {} })
410-
}).makeDecryptionContext(serialize({}));
408+
let context: MongoCryptContext;
409+
beforeEach(() => {
410+
context = new MongoCrypt({
411+
kmsProviders: serialize({ aws: {} })
412+
}).makeDecryptionContext(serialize({}));
413+
})
411414

412415
for (const property of ['status', 'state']) {
413416
it(`it has a property .${property}`, () => {
@@ -442,4 +445,4 @@ describe('MongoCryptContext', () => {
442445
).not.to.throw();
443446
});
444447
});
445-
});
448+
});

0 commit comments

Comments
 (0)