Skip to content

Commit

Permalink
moved global.Promise reset to afterEach hook
Browse files Browse the repository at this point in the history
  • Loading branch information
lpizzinidev committed Jan 9, 2023
1 parent 264334a commit a3334d0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/docs/promises.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@ describe('promises docs', function () {
});

after(async function () {
global.Promise = defaultPromise;

await db.close();
});

afterEach(function () {
global.Promise = defaultPromise;
});

/**
* Mongoose async operations, like `.save()` and queries, return thenables.
* This means that you can do things like `MyModel.findOne({}).then()` and
Expand Down

0 comments on commit a3334d0

Please sign in to comment.