1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 15:57:35 +00:00

LibJS/Tests: Test iteration order of Map.prototype.keys()

This commit is contained in:
Linus Groh 2021-08-13 23:52:33 +01:00
parent f00fde46f6
commit ea44d9e194

View file

@ -10,16 +10,9 @@ test("basic functionality", () => {
];
const a = new Map(original);
const it = a.keys();
// FIXME: This test should be rewritten once we have proper iteration order
const first = it.next();
expect(first.done).toBeFalse();
expect(a.has(first.value)).toBeTrue();
const second = it.next();
expect(second.done).toBeFalse();
expect(a.has(second.value)).toBeTrue();
const third = it.next();
expect(third.done).toBeFalse();
expect(a.has(third.value)).toBeTrue();
expect(it.next()).toEqual({ value: "a", done: false });
expect(it.next()).toEqual({ value: "b", done: false });
expect(it.next()).toEqual({ value: "c", done: false });
expect(it.next()).toEqual({ value: undefined, done: true });
expect(it.next()).toEqual({ value: undefined, done: true });
expect(it.next()).toEqual({ value: undefined, done: true });