summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2021-08-13 23:52:33 +0100
committerLinus Groh <mail@linusgroh.de>2021-08-13 23:53:40 +0100
commitea44d9e194050cf9d47d20ea3e4595a1a6233962 (patch)
treebff03c94391003caa8ec0e57ecf27eb1d7d2899e /Userland
parentf00fde46f6d6ead7855e0500a9fcfebfe9d60398 (diff)
downloadserenity-ea44d9e194050cf9d47d20ea3e4595a1a6233962.zip
LibJS/Tests: Test iteration order of Map.prototype.keys()
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Libraries/LibJS/Tests/builtins/Map/Map.prototype.keys.js13
1 files changed, 3 insertions, 10 deletions
diff --git a/Userland/Libraries/LibJS/Tests/builtins/Map/Map.prototype.keys.js b/Userland/Libraries/LibJS/Tests/builtins/Map/Map.prototype.keys.js
index 2734be1308..bf69fce257 100644
--- a/Userland/Libraries/LibJS/Tests/builtins/Map/Map.prototype.keys.js
+++ b/Userland/Libraries/LibJS/Tests/builtins/Map/Map.prototype.keys.js
@@ -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 });