Skip to content

Commit

Permalink
Regression test for prototype and non-enumerable properties in minimo…
Browse files Browse the repository at this point in the history
…ngo (#9516)
  • Loading branch information
jamesmillerburgess authored and benjamn committed Jan 10, 2018
1 parent ed98a07 commit 3638897
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions packages/minimongo/minimongo_tests_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,24 @@ Tinytest.add('minimongo - basics', test => {
test.equal(c.find({a: 'a', b: noop}).count(), 1);
test.equal(c.find({c: noop}).count(), 1);
test.equal(c.find({a: noop, c: 'c'}).count(), 0);

// Regression test for #4260
// Only insert enumerable, own properties from the object
c.remove({});
function Thing() {
this.a = 1;
this.b = 2;
Object.defineProperty(this, 'b', { enumerable: false });
}
Thing.prototype.c = 3;
Thing.prototype.d = () => null;
const before = new Thing();
c.insert(before);
const after = c.findOne();
test.equal(after.a, 1);
test.equal(after.b, undefined);
test.equal(after.c, undefined);
test.equal(after.d, undefined);
});

Tinytest.add('minimongo - error - no options', test => {
Expand Down

0 comments on commit 3638897

Please sign in to comment.