intro-mongo-db icon indicating copy to clipboard operation
intro-mongo-db copied to clipboard

persist database connection between tests

Open robhhr opened this issue 5 years ago • 4 comments

When running tests on exercises/models an error stops the tests due to MongoError: pool is draining, new operations prohibited. Refactored testconfig.js to execute mongoose.disconnect() after all the tests have been completed instead of after each test.

robhhr avatar Feb 15 '20 09:02 robhhr

@Hendrixer 🙏

roma219 avatar Mar 06 '20 08:03 roma219

@Hendrixer hope you have a minute to take a look at this soon. Solved my testing woes 😄

learnsometing avatar Jul 25 '20 16:07 learnsometing

yup @Hendrixer this solved for me too. However @robhhr did this stop the jest --watch functionality from working ?

craigmark0 avatar Aug 13 '20 03:08 craigmark0

@robhhr I was searching for this for so long. Thank you !

Jest tests failing with error MongoError: pool is draining, new operations prohibited

@Hendrixer ping! :)

McQuinTrix avatar Oct 22 '20 06:10 McQuinTrix