I am doing some async testing with nodeunit and I was wondering whether it is possible to tell nodeunit to not terminate test cases until test.done is called.
Basically this is how my test cases looks like right now:
exports.basic = testCase({
setUp: function (callback) {
this.ws = new WrappedServer();
this.ws.run(PORT);
callback();
},
tearDown: function (callback) {
callback();
},
testFoo: function(test) {
var socket = ioClient.connect(URL);
socket.emit('PING', 1, 1);
socket.on('PONG', function() {
// do some assertion of course
test.done();
});
}
});
The problem now is that PONG is not sent back quick enough for the test code to be executed. Any ideas?