Skip to content

Commit

Permalink
test(query): repro #7629
Browse files Browse the repository at this point in the history
  • Loading branch information
vkarpov15 committed Apr 7, 2019
1 parent a9fcf85 commit d101c68
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/query.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3369,6 +3369,22 @@ describe('Query', function() {
);
});

it('sets deletedCount on result of remove() (gh-7629)', function() {
const schema = new Schema({ name: String });

const Model = db.model('gh7629', schema);

return co(function*() {
yield Model.create({ name: 'foo' });

let res = yield Model.remove({});
assert.equal(res.deletedCount, 1);

res = yield Model.remove({});
assert.strictEqual(res.deletedCount, 0);
});
});

describe('merge()', function() {
it('copies populate() (gh-1790)', function() {
const Car = db.model('gh1790_Car', {
Expand Down

0 comments on commit d101c68

Please sign in to comment.