mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
fix many test problems (#1677)
* fix many test problems - adds [stoppable](https://npm.im/stoppable) to force-stop net & http servers - upgrades to latest mocha - much cleanup of servers - some removal of useless code Signed-off-by: Christopher Hiller <boneskull@boneskull.com> * increase wait time to hack at race condition * PoC with fork of stoppable Signed-off-by: Christopher Hiller <boneskull@boneskull.com> * fix custom stoppable url for newer npm * make travis go faster; attempt to avoid npm troubles * fix coveralls executable path * add extra time for flake to trigger spec Signed-off-by: Christopher Hiller <boneskull@boneskull.com>
This commit is contained in:
committed by
Nick O'Leary
parent
25345302e8
commit
e1195ac00a
@@ -16,6 +16,7 @@
|
||||
|
||||
var net = require("net");
|
||||
var should = require("should");
|
||||
var stoppable = require('stoppable');
|
||||
var helper = require("../../helper.js");
|
||||
var tcpinNode = require("../../../../nodes/core/io/31-tcpin.js");
|
||||
|
||||
@@ -26,7 +27,7 @@ describe('TCP Request Node', function() {
|
||||
|
||||
function startServer(done) {
|
||||
port += 1;
|
||||
server = net.createServer(function(c) {
|
||||
server = stoppable(net.createServer(function(c) {
|
||||
c.on('data', function(data) {
|
||||
var rdata = "ACK:"+data.toString();
|
||||
c.write(rdata);
|
||||
@@ -34,7 +35,7 @@ describe('TCP Request Node', function() {
|
||||
c.on('error', function(err) {
|
||||
startServer(done);
|
||||
});
|
||||
}).listen(port, "127.0.0.1", function(err) {
|
||||
})).listen(port, "127.0.0.1", function(err) {
|
||||
done();
|
||||
});
|
||||
}
|
||||
@@ -43,8 +44,8 @@ describe('TCP Request Node', function() {
|
||||
startServer(done);
|
||||
});
|
||||
|
||||
after(function() {
|
||||
server.close();
|
||||
after(function(done) {
|
||||
server.stop(done);
|
||||
});
|
||||
|
||||
afterEach(function() {
|
||||
|
Reference in New Issue
Block a user