I am working on nodejs project. And I am using nodeunit npm module to test my server-side codebase. I am using Webstorm as an editor for writing my codes and also testing the server-side code with the help of nodeunit module.
Everything is working perfectly, my test cases passed correctly but the test cases progress is keep loading in Webstorm status panel. I have manually to stop that each time. Does anybody have any idea on this?
Are you calling done() at the end? For example
exports.globalSetterTest = function(test){
var app = require('../helpers/globalsetter');
app.setData("abc");
var res = app.getData();
test.equal(res, "abc", "msg");
test.done();
};
I have the same setup as you and here are some sample tests I wrote. https://github.com/captainchung/webstormNodeUnitTests/blob/master/test/spec.js
I had the same problem: all nodeunit tests pass, but Webstorm's spinner keeps going forever. I solved it by explicitly closing the database connection that was opened by the code under test -- something I didn't have to do outside test code because my database driver prefers to keep the connections alive in a connection pool.