Having some issues in writing jasmine unit tests that involve mongoose connections. I'm trying to do some variations of :
beforeEach(function() {
mongoose.connect('localhost', 'test');
});
afterEach(function() {
mongoose.disconnect();
});
I've only started adding this to the beforeEach and afterEach blocks when I realized that tests weren't stopping without me going in and Ctrl+C-ing them. Tests pass so the connection is working but it seems that disconnect isn't working properly.
Anybody have experience in this situation or have had similar issues?
Appreciate any feedback.
Cheers,
Matt