Skip to content

Commit

Permalink
fix leak
Browse files Browse the repository at this point in the history
  • Loading branch information
baileympearson committed Feb 4, 2025
1 parent 79b632f commit e08bd1a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions test/unit/api.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe('wrapper API', () => {
collection = new mongodbLegacy.Collection(db, 'pets', {});
namespace = MongoDBNamespace.fromString('animals.pets');

client.connect().catch(_e => {});
client.connect().catch(_e => { });

Check failure on line 29 in test/unit/api.test.js

View workflow job for this annotation

GitHub Actions / check

Delete `·`

instance = makeInstance(
{
Expand All @@ -40,6 +40,8 @@ describe('wrapper API', () => {
});

afterEach(async function () {
sinon.restore();

if (className === 'ClientSession' && method !== 'endSession') {
await instance.endSession();
}
Expand All @@ -49,7 +51,7 @@ describe('wrapper API', () => {
if (className === 'GridFSBucketWriteStream' && method !== 'end') {
await instance.end();
}

await client.close();
sinon.restore();
});
const resolveSuite = [];
Expand Down Expand Up @@ -219,7 +221,7 @@ function makeInstance({ client, db, namespace, collection }, className) {
'GridFSBucketWriteStream',
() => {
const stream = new mongodbLegacy.GridFSBucket(db).openUploadStream('file');
stream.on('error', () => {});
stream.on('error', () => { });

Check failure on line 224 in test/unit/api.test.js

View workflow job for this annotation

GitHub Actions / check

Delete `·`
return stream;
}
],
Expand Down

0 comments on commit e08bd1a

Please sign in to comment.