Skip to content

Commit

Permalink
Remove filter test
Browse files Browse the repository at this point in the history
  • Loading branch information
AbdelrahmanHafez committed Nov 19, 2019
1 parent 4599877 commit 63c2f1e
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions test/types.documentarray.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -588,25 +588,6 @@ describe('types.documentarray', function() {
assert.equal(friendsNames.length, 2);
assert.equal(friendsNames[1], 'Sam');
});

it('filter() copies parent and path (gh-8317)', function() {
const personSchema = new Schema({ friends: [{ name: { type: String }, age: { type: Number } }] });
const Person = mongoose.model('gh8317-filter', personSchema);

const person = new Person({ friends: [
{ name: 'Hafez', age: 25 },
{ name: 'Sam', age: 27 }
] });

const filteredFriends = person.friends.filter(friend => friend.age > 26);
assert.ok(filteredFriends.isMongooseArray);
assert.equal(filteredFriends.constructor.name, 'CoreDocumentArray');

filteredFriends.push({ name: 'John', age: 30 });

assert.equal(filteredFriends.length, 2);
assert.equal(filteredFriends[1].name, 'John');
});
});

it('cleans modified subpaths on splice() (gh-7249)', function() {
Expand Down

0 comments on commit 63c2f1e

Please sign in to comment.