Comparing version 2.3.4 to 2.4.0
@@ -0,1 +1,6 @@ | ||
## 2.4.0/2016-12-20 | ||
- update error stack | ||
- fix tests | ||
## 2.3.4/2016-12-18 | ||
@@ -2,0 +7,0 @@ |
@@ -191,5 +191,9 @@ 'use strict'; | ||
function addMongoErrorDetail(e) { | ||
// overwrite error stack | ||
e.stack = this.stack; | ||
//only for mongoError | ||
// concat extra error stack | ||
e.stack = ` | ||
${e.stack} | ||
----- Mongolass error stack ----- | ||
${this.stack} | ||
`; | ||
// only for mongoError | ||
if (!e.model) { | ||
@@ -196,0 +200,0 @@ e.op = this._op; |
{ | ||
"name": "mongolass", | ||
"version": "2.3.4", | ||
"version": "2.4.0", | ||
"description": "Elegant MongoDB driver for Node.js.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -40,2 +40,20 @@ 'use strict'; | ||
it('connect failed', function* () { | ||
let error; | ||
const mongolass2 = new Mongolass('mongodb://localhost:27018/test'); | ||
try { | ||
yield mongolass2.model('User').find(); | ||
} catch (e) { | ||
error = e; | ||
} | ||
assert.deepEqual(error, { | ||
name: 'MongoError', | ||
message: 'failed to connect to server [localhost:27018] on first connect', | ||
op: 'find', | ||
args: [], | ||
model: 'User', | ||
schema: null | ||
}); | ||
}); | ||
it('disconnect', function* () { | ||
@@ -42,0 +60,0 @@ let mongolass2 = new Mongolass(); |
@@ -11,3 +11,3 @@ 'use strict'; | ||
describe('index.js', function () { | ||
describe('model.js', function () { | ||
before(function* () { | ||
@@ -14,0 +14,0 @@ yield mongolass.model('User').insertOne({ name: 'aaa', age: 2 }); |
@@ -12,3 +12,3 @@ 'use strict'; | ||
describe('index.js', function () { | ||
describe('plugins.js', function () { | ||
before(function* () { | ||
@@ -15,0 +15,0 @@ yield mongolass.model('User').insertOne({ name: 'aaa', age: 2 }); |
@@ -37,3 +37,3 @@ 'use strict'; | ||
it('ObjectId', function* () { | ||
let user = yield User.findOne(); | ||
let user = yield User.findOne({ uid: '5721bb5abec50ab84b8eb109' }); | ||
assert.ok('object' === typeof user._id); | ||
@@ -40,0 +40,0 @@ assert.deepEqual(user.uid.toString(), '5721bb5abec50ab84b8eb109'); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
77097
1948