1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Close comms on stopServer in test helper (#1020)

* Close comms on stopServer in test helper

Using this file in another project to test nodes, when running tests with gulp and karma the process never ends as comms are still open.
This resolves the problem.

* Moved test helper server on close to stopServer method
This commit is contained in:
Monkey Do 2016-11-16 15:09:04 +01:00 committed by Nick O'Leary
parent 339aaaec57
commit 9790211891

View File

@ -149,6 +149,9 @@ module.exports = {
stopServer: function(done) { stopServer: function(done) {
if (server) { if (server) {
try { try {
server.on('close', function() {
comms.stop();
});
server.close(done); server.close(done);
} catch(e) { } catch(e) {
done(); done();