Skip to content

Commit 64391bb

Browse files
author
martin-doyle
committed
Change server error unit test
1 parent edcfa55 commit 64391bb

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

test/server_error.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ describe('mosca.Server.error', function () {
4343
setImmediate(done);
4444
});
4545
});
46-
it('should get MQTT port Error: listen EADDRINUSE :::1883', function (done) {
46+
it('should get MQTT port Error: listen EADDRINUSE', function (done) {
4747
this.timeout(10000); // have to wait for the inject with delay of two seconds
4848
instance = new mosca.Server(moscaSettings(), function (err, server) {
4949
expect(server === instance).to.be.true;
@@ -52,11 +52,11 @@ describe('mosca.Server.error', function () {
5252
expect(server === secondInstance).to.be.true;
5353
});
5454
secondInstance.on('error', function (err) {
55-
expect(err.toString()).to.be.equal('Error: listen EADDRINUSE :::1883');
55+
expect(err.toString().substr(0, 24)).to.be.equal('Error: listen EADDRINUSE');
5656
done();
5757
});
5858
});
59-
it('should get HTTP port Error: listen EADDRINUSE :::8000', function (done) {
59+
it('should get HTTP port Error: listen EADDRINUSE', function (done) {
6060
this.timeout(10000); // have to wait for the inject with delay of two seconds
6161
instance = new mosca.Server(moscaSettings(), function (err, server) {
6262
expect(server === instance).to.be.true;
@@ -65,7 +65,7 @@ describe('mosca.Server.error', function () {
6565
expect(server === secondInstance).to.be.true;
6666
});
6767
secondInstance.on('error', function (err) {
68-
expect(err.toString()).to.be.equal('Error: listen EADDRINUSE :::8000');
68+
expect(err.toString().substr(0, 24)).to.be.equal('Error: listen EADDRINUSE');
6969
done();
7070
});
7171
});

0 commit comments

Comments
 (0)