Closed seawatts closed 9 years ago
The reason for this PR is because I was having some issues where mocha would not exit cleanly because there were still connections open to the database. By calling close on the database it resolves this issue and mocha can exit cleanly.
You can see here https://mongodb.github.io/node-mongodb-native/api-generated/mongoclient.html#mongoclient-connect that they do the same thing after they open a connection.
I wasn't sure how to even test this, so I didn't add any tests sorry.
Thank you for the PR!
Yeah, it would be hard to test it in any meaningful way. This looks good, and I hope it helps!
v1.1.1 published with this fix
Woot! :tada: Thanks :+1:
The reason for this PR is because I was having some issues where mocha would not exit cleanly because there were still connections open to the database. By calling close on the database it resolves this issue and mocha can exit cleanly.
You can see here https://mongodb.github.io/node-mongodb-native/api-generated/mongoclient.html#mongoclient-connect that they do the same thing after they open a connection.
I wasn't sure how to even test this, so I didn't add any tests sorry.