Skip to content
This repository has been archived by the owner on Feb 11, 2020. It is now read-only.

Commit

Permalink
Change server error unit test, add check if err is null
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-doyle committed Apr 5, 2018
1 parent 64391bb commit 9005cac
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/server_error.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
var steed = require('steed');
var assert = chai.assert;

var moscaSettings = function () {
return {
Expand Down Expand Up @@ -46,9 +47,11 @@ describe('mosca.Server.error', function () {
it('should get MQTT port Error: listen EADDRINUSE', function (done) {
this.timeout(10000); // have to wait for the inject with delay of two seconds
instance = new mosca.Server(moscaSettings(), function (err, server) {
assert.ifError(err);
expect(server === instance).to.be.true;
});
secondInstance = new mosca.Server(moscaSettings(), function (err, server) {
assert.ifError(err);
expect(server === secondInstance).to.be.true;
});
secondInstance.on('error', function (err) {
Expand All @@ -59,9 +62,11 @@ describe('mosca.Server.error', function () {
it('should get HTTP port Error: listen EADDRINUSE', function (done) {
this.timeout(10000); // have to wait for the inject with delay of two seconds
instance = new mosca.Server(moscaSettings(), function (err, server) {
assert.ifError(err);
expect(server === instance).to.be.true;
});
secondInstance = new mosca.Server(moscaSettings2(), function (err, server) {
assert.ifError(err);
expect(server === secondInstance).to.be.true;
});
secondInstance.on('error', function (err) {
Expand Down

0 comments on commit 9005cac

Please sign in to comment.