LibJS: Add tests for symbol object integration

This commit is contained in:
Matthew Olsson 2020-07-07 21:39:36 -07:00 committed by Andreas Kling
commit 119386ffb0
Notes: sideshowbarker 2024-07-19 04:59:35 +09:00
13 changed files with 198 additions and 13 deletions

View file

@ -14,6 +14,11 @@ describe("correct behavior", () => {
expect(keys).toEqual(["foo", "bar", "baz"]);
});
test("object argument with symbol keys", () => {
let keys = Object.keys({ foo: 1, [Symbol("bar")]: 2, baz: 3 });
expect(keys).toEqual(["foo", "baz"]);
});
test("array argument", () => {
let keys = Object.keys(["a", "b", "c"]);
expect(keys).toEqual(["0", "1", "2"]);