diff --git a/package.json b/package.json index 714323ba4..46771b251 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "bson": "^1.0.6", "debug": "^3.1.0", "loopback-connector": "^4.5.0", - "mongodb": "^3.1.4", + "mongodb": "^3.2.4", "strong-globalize": "^4.1.1" }, "devDependencies": { diff --git a/test/mongodb.test.js b/test/mongodb.test.js index 3e7be7a42..aa80b5e7f 100644 --- a/test/mongodb.test.js +++ b/test/mongodb.test.js @@ -57,7 +57,9 @@ describe('lazyConnect', function() { }); ds.on('error', function(err) { - err.code.should.eql('ECONNREFUSED'); + should.exist(err); + err.name.should.equal('MongoNetworkError'); + err.message.should.match(/ECONNREFUSED/); done(); }); }); @@ -361,8 +363,9 @@ describe('mongodb connector', function() { port: 4, // unassigned by IANA }); ds.ping(function(err) { - (!!err).should.be.True(); - err.code.should.eql('ECONNREFUSED'); + should.exist(err); + err.name.should.equal('MongoNetworkError'); + err.message.should.match(/ECONNREFUSED/); done(); }); });