Skip to content

Commit

Permalink
Greenkeeper/mongoose 4.10.4 (#195)
Browse files Browse the repository at this point in the history
* chore(package): update mongoose to version 4.10.4

* Fix test for new Mongoose error message
  • Loading branch information
daffl authored May 30, 2017
1 parent a764e37 commit 1502955
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
"feathers-socketio": "^2.0.0",
"istanbul": "^1.1.0-alpha.1",
"mocha": "^3.0.0",
"mongoose": "^4.5.2",
"mongoose": "^4.10.4",
"rimraf": "^2.5.2",
"semistandard": "^11.0.0",
"sinon": "^2.0.0",
Expand Down
11 changes: 6 additions & 5 deletions test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,14 +286,15 @@ describe('Feathers Mongoose Service', () => {
}).catch(done);
});

it('runs validators on update', function (done) {
people.create({ name: 'David', age: 33 })
it('runs validators on update', function () {
return people.create({ name: 'David', age: 33 })
.then(person => people.update(person._id, { name: 'Dada', age: 'wrong' }))
.then(() => done(new Error('Update should not be successful')))
.then(() => {
throw new Error('Update should not be successful');
})
.catch(error => {
expect(error.name).to.equal('BadRequest');
expect(error.message).to.equal('Cast to number failed for value "wrong" at path "age"');
done();
expect(error.message).to.equal('User validation failed: age: Cast to Number failed for value "wrong" at path "age"');
});
});

Expand Down

0 comments on commit 1502955

Please sign in to comment.