Skip to content

Commit

Permalink
test: add test that non-own properties are skipped
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomi Turtiainen committed Mar 6, 2021
1 parent 3ef8cf0 commit e853da4
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/fromfrom.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,15 @@ describe("fromfrom", () => {
expect(sequence.toArray()).toEqual([["a", 1], ["b", 2]]);
expect(sequence.toArray()).toEqual([["a", 1], ["b", 2]]);
});

it("skips inherited properties", () => {
const parent = { p: 10 };
const obj = Object.create(parent, {
a: { value: 1, enumerable: true },
});

expect(from(obj).toArray()).toEqual([["a", 1]]);
});
});
});

Expand Down

0 comments on commit e853da4

Please sign in to comment.