Skip to content

Commit

Permalink
Merge pull request #8699 from AbdelrahmanHafez/refactor-test
Browse files Browse the repository at this point in the history
refactor test for #8331
  • Loading branch information
vkarpov15 committed Mar 21, 2020
2 parents c4c6bf8 + 7053743 commit a48fd34
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions test/model.test.js
Expand Up @@ -5541,18 +5541,14 @@ describe('Model', function() {
return co(function*() {
const createdUser = yield User.create({ name: 'Hafez' });

let err;
const err = yield User.bulkWrite([{
updateOne: {
filter: { _id: createdUser._id }
}
}])
.then(()=>null)
.catch(err=>err);

try {
yield User.bulkWrite([{
updateOne: {
filter: { _id: createdUser._id }
}
}]);
}
catch (_err) {
err = _err;
}

assert.ok(err);
assert.equal(err.message, 'Must provide an update object.');
Expand Down

0 comments on commit a48fd34

Please sign in to comment.