atlas2
atlas2 copied to clipboard
Tests leak something
trafficstars
Mocha has changed behaviour, and right now it does not quit by default after iterating through all tests, but waits for the process (processes) to exit naturally. It does not happen for my tests.
I had to add --quit flag to mocha as a workaround.
Any help with this is welcome.
After initial investigation - it is necessary to shut down the entire stack in appropriate way. Things one have to remember can be summarised in this snippet:
after(function(done) {
app.___imageRendererModule.shutdown()
.then(function() {
app.___conn.db.dropDatabase(function() {
app.___conn.close(function() {
app.close(function() {
done();
});
});
});
});
});
But messing with connections borks the model (Workspace, WardleyMap, Node). I have to review how the connection is passed to the model, and ensure tests are trully independent. It will help the main app, too.