diff --git a/lib/adapters/mongodb.js b/lib/adapters/mongodb.js index f9d493d3..beaf85fb 100644 --- a/lib/adapters/mongodb.js +++ b/lib/adapters/mongodb.js @@ -71,8 +71,7 @@ function MongoDB(s, schema, callback) { if (err) throw err; if (s.username && s.password) { t = this; - client.authenticate(s.username, s.password, function(err, result) { - if (err) throw err; + client.authenticate(s.username, s.password, function (err, result) { t.client = client; schema.client = client; callback(); @@ -231,4 +230,4 @@ MongoDB.prototype.updateAttributes = function updateAttrs(model, id, data, cb) { MongoDB.prototype.disconnect = function () { this.client.close(); -}; \ No newline at end of file +}; diff --git a/test/common_test.js b/test/common_test.js index 9cdc956f..1e32cc3d 100644 --- a/test/common_test.js +++ b/test/common_test.js @@ -37,11 +37,11 @@ if (process.env.ONLY && !testPerformed) { } function performTestFor(schemaName) { + testPerformed = true; context(schemaName, function () { var schema = new Schema(schemaName, schemas[schemaName] || {}); it('should connect to database', function (test) { - testPerformed = true; if (schema.connected) return test.done(); schema.on('connected', test.done); });