Skip to content

Commit

Permalink
test(findOneAndUpdate): add extra assertions from code review for #13437
Browse files Browse the repository at this point in the history


Re: #13413
  • Loading branch information
vkarpov15 committed May 25, 2023
1 parent 2457994 commit 30dab2e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/model.findOneAndUpdate.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2111,12 +2111,14 @@ describe('model: findOneAndUpdate:', function() {
{ $set: { name: 'Test' } },
{ projection: '+nickName', returnDocument: 'after' }
);
assert.equal(res.name, 'Test');
assert.equal(res.nickName, 'Quiz');

res = await Test.findOneAndDelete(
{ _id: entry._id },
{ projection: '+nickName', returnDocument: 'before' }
);
assert.equal(res.name, 'Test');
assert.equal(res.nickName, 'Quiz');
});
});

0 comments on commit 30dab2e

Please sign in to comment.