Please always close your MongoDB connection after testing

I am working on a Node.JS app and writing unit tests, which are testing database operations. Since I wanted to TEST, I setup a new MongoDB connection for an extra test database. When I ran the test I could see in Test Explorer that the test did not stop running, even after calling done(); (this is Mocha). After fiddling around thinking it was about the asynchronous model I went in the callstack after in “done”....

November 25, 2014 · 1 min · 111 words · Gian Sass