Skip to content

Commit

Permalink
test: correct error paths in tests now that ValidationErrors assimila…
Browse files Browse the repository at this point in the history
…te other ValidationErrors

Re: #11945
Re: #4953
Re: #5269
  • Loading branch information
vkarpov15 committed Jul 18, 2022
1 parent 9ecbfeb commit 2534dd1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/model.update.test.js
Expand Up @@ -1917,7 +1917,7 @@ describe('model: update:', function() {
const opts = { new: true, runValidators: true };
Model.findOneAndUpdate({}, update, opts, function(error) {
assert.ok(error);
assert.ok(error.errors['children']);
assert.ok(error.errors['children.lastName']);
done();
});
});
Expand Down Expand Up @@ -2383,9 +2383,9 @@ describe('model: update:', function() {

Parent.update({}, { d: { d2: 'test' } }, { runValidators: true }, function(error) {
assert.ok(error);
assert.ok(error.errors['d']);
assert.ok(error.errors['d'].message.indexOf('Path `d1` is required') !== -1,
error.errors['d'].message);
assert.ok(error.errors['d.d1']);
assert.ok(error.errors['d.d1'].message.indexOf('Path `d1` is required') !== -1,
error.errors['d.d1'].message);
done();
});
});
Expand Down

0 comments on commit 2534dd1

Please sign in to comment.