From 02503e763569d638911cb4f9b0550b7fa2558d63 Mon Sep 17 00:00:00 2001 From: Raymond Feng Date: Fri, 20 Feb 2015 09:33:54 -0800 Subject: [PATCH 1/2] Fix createdAt type so that it won't overflow SQL server int --- test/manipulation.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/manipulation.test.js b/test/manipulation.test.js index 03a42d41..45b6929d 100644 --- a/test/manipulation.test.js +++ b/test/manipulation.test.js @@ -15,7 +15,7 @@ describe('manipulation', function () { married: Boolean, age: {type: Number, index: true}, dob: Date, - createdAt: {type: Number, default: Date.now} + createdAt: {type: Date, default: Date} }, { forceId: true }); db.automigrate(done); From a713f25d61006ee36846a817436ad6a44cde5ab0 Mon Sep 17 00:00:00 2001 From: Raymond Feng Date: Fri, 20 Feb 2015 09:55:09 -0800 Subject: [PATCH 2/2] Fix the null/undefined check --- test/manipulation.test.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/manipulation.test.js b/test/manipulation.test.js index 45b6929d..b5865fe4 100644 --- a/test/manipulation.test.js +++ b/test/manipulation.test.js @@ -206,11 +206,13 @@ describe('manipulation', function () { Person.findById(created.id, function(err, found) { if (err) return done(err); - found.toObject().should.have.properties({ + var result = found.toObject(); + result.should.have.properties({ id: created.id, - name: 'a-name', - gender: undefined + name: 'a-name' }); + // The gender can be null from a RDB + should.equal(result.gender, null); done(); }); });