From 39d2dfebffba25f8be0075e70830d866a22e316f Mon Sep 17 00:00:00 2001 From: Romain Beaumont Date: Sun, 20 Sep 2015 20:26:31 +0200 Subject: [PATCH] check the error in the callback of wrap.startServer --- test/test.js | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/test/test.js b/test/test.js index 8e8a2ee..f903648 100644 --- a/test/test.js +++ b/test/test.js @@ -222,7 +222,9 @@ describe("client", function() { wrap.startServer({ motd: 'test1234', 'max-players': 120, - }, function() { + }, function(err) { + if(err) + return done(err); mc.ping({}, function(err, results) { if(err) return done(err); assert.ok(results.latency >= 0); @@ -241,7 +243,9 @@ describe("client", function() { }); }); it.skip("connects successfully - online mode (STUBBED)", function(done) { - wrap.startServer({'online-mode': 'true'}, function() { + wrap.startServer({'online-mode': 'true'}, function(err) { + if(err) + return done(err); var client = mc.createClient({ username: process.env.MC_USERNAME, password: process.env.MC_PASSWORD, @@ -270,7 +274,9 @@ describe("client", function() { done(); }); it.skip("connects successfully - offline mode (STUBBED)", function(done) { - wrap.startServer({'online-mode': 'false'}, function() { + wrap.startServer({'online-mode': 'false'}, function(err) { + if(err) + return done(err); var client = mc.createClient({ username: 'Player', }); @@ -319,7 +325,9 @@ describe("client", function() { done(); }); it("gets kicked when no credentials supplied in online mode", function(done) { - wrap.startServer({'online-mode': 'true'}, function() { + wrap.startServer({'online-mode': 'true'}, function(err) { + if(err) + return done(err); var client = mc.createClient({ username: 'Player', }); @@ -335,7 +343,9 @@ describe("client", function() { }); }); it("does not crash for " + SURVIVE_TIME + "ms", function(done) { - wrap.startServer({'online-mode': 'false'}, function() { + wrap.startServer({'online-mode': 'false'}, function(err) { + if(err) + return done(err); var client = mc.createClient({ username: 'Player', });