Skip to content

Commit b21e531

Browse files
committed
fix: add test to verify preservation of first occurrence order in dedupe function
1 parent c9a0b25 commit b21e531

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎Sprint-1/implement/dedupe.test.js‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ test("returns a a copy with no duplicates", () => {
2424
expect(dedupe(["a", "a", "a", "b", "b", "c"])).toEqual(["a", "b", "c"]);
2525
});
2626

27+
test("keeps the first occurrence order", () => {
28+
expect(dedupe([5, 1, 1, 2, 3, 2, 5, 8])).toEqual([5, 1, 2, 3, 8]);
29+
});
30+
31+
2732
// Given an array with no duplicates
2833
// When passed to the dedupe function
2934
// Then it should return a copy of the original array

0 commit comments

Comments
 (0)