diff --git a/tests/functional.js b/tests/functional.js index bbdaf78..a21abea 100644 --- a/tests/functional.js +++ b/tests/functional.js @@ -27,6 +27,7 @@ if (!process.browser) { }); it("should resolve DNS seeds on bootstrap", function() { + this.timeout(10000); var tcp2 = new TcpTransport({ dnsSeeds: [["bootstrap8444.bitmessage.org", 8444]], }); @@ -37,6 +38,7 @@ if (!process.browser) { }); it("should return hardcoded seeds on bootstrap", function() { + this.timeout(10000); var tcp3 = new TcpTransport({ seeds: [["1.1.1.1", 8080]], dnsSeeds: [["bootstrap8444.bitmessage.org", 8444]], diff --git a/tests/run-test-nodes.js b/tests/run-test-nodes.js index a00e4d9..4762b32 100644 --- a/tests/run-test-nodes.js +++ b/tests/run-test-nodes.js @@ -6,16 +6,13 @@ var path = require("path"); var child = require("child_process"); -var TCP_NODE_PATH = path.join(__dirname, "tcp-node.js"); -var WS_NODE_PATH = path.join(__dirname, "ws-node.js"); - -function spawn(path) { - var p = child.spawn("node", [path]); +function spawn(name) { + var p = child.spawn("node", [path.join(__dirname, name)]); p.stdout.on("data", function(data) { - console.log("Info from", path, ":", data.toString().trim()); + console.log("Info from " + name + ": " + data.toString().trim()); }); p.stderr.on("data", function(err) { - console.log("Error from", path, ":", err.toString()); + console.log("Error from " + name + ": " + err.toString().trim()); }); return p; } @@ -38,9 +35,10 @@ module.exports = function() { }; } - var tcpNode = spawn(TCP_NODE_PATH); - var wsNode = spawn(WS_NODE_PATH); process.on("exit", cleanup()); process.on("SIGINT", cleanup(true)); process.on("uncaughtException", cleanup(true)); + + var tcpNode = spawn("tcp-node.js"); + var wsNode = spawn("ws-node.js"); }; diff --git a/tests/unit.js b/tests/unit.js index c8f739b..b8880f2 100644 --- a/tests/unit.js +++ b/tests/unit.js @@ -383,7 +383,7 @@ describe("Common structures", function() { expect(net_addr.decode(encoded).host).to.equal("127.0.0.1"); }); - it("should encode bad IPv4", function() { + it("shouldn't encode bad IPv4", function() { var opts = {host: " 127.0.0.1", port: 1234}; expect(net_addr.encode.bind(null, opts)).to.throw(/bad octet/i); });