Closed grmmph closed 4 years ago
Thanks!
On Thu, Apr 23, 2020 at 3:29 PM Shaun Burdick notifications@github.com wrote:
You need to make sure you call the close() function as it clears the setInterval(): https://github.com/williamkapke/mongo-mock/blob/master/lib/db.js#L27 Commonly, in mocha, you would build your connection in a before() or beforeEach() and close the connection in an after() or afterEach()
Take a look at the library's unit tests for an example: https://github.com/williamkapke/mongo-mock/blob/master/test/mock.test.js#L16
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/williamkapke/mongo-mock/pull/127#issuecomment-618373786, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABHIM5U6353Y4YDDJJYYH73ROAYBJANCNFSM4MO5LVFQ .
You need to make sure you call the
close()
function as it clears the setInterval(): https://github.com/williamkapke/mongo-mock/blob/master/lib/db.js#L27 Commonly, in mocha, you would build your connection in abefore()
orbeforeEach()
and close the connection in anafter()
orafterEach()
Take a look at the library's unit tests for an example: https://github.com/williamkapke/mongo-mock/blob/master/test/mock.test.js#L16