Skip to content

Commit

Permalink
test: add coverage for constructor properties
Browse files Browse the repository at this point in the history
  • Loading branch information
vkarpov15 committed Jul 9, 2023
1 parent e29578d commit cc722a1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/document.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12229,6 +12229,18 @@ describe('document', function() {
const test = {};
assert.strictEqual(test.polluted, undefined);
assert.strictEqual(Object.prototype.polluted, undefined);

const example2 = await new Example({ hello: 'world!' }).save();
await Example.findByIdAndUpdate(example2._id, {
$rename: {
hello: 'constructor.polluted'
}
});

await Example.find();
const test2 = {};
assert.strictEqual(test2.constructor.polluted, undefined);
assert.strictEqual(Object.polluted, undefined);
});
});

Expand Down

0 comments on commit cc722a1

Please sign in to comment.