williamkapke / mongo-mock

Let's pretend we have a real MongoDB
MIT License
240 stars 75 forks source link

remove setinterval #127

Closed grmmph closed 4 years ago

shaunburdick commented 4 years ago

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

grmmph commented 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 .