Skip to content

Commit 7d531a4

Browse files
committed
fix: implement test for empty array case in dedupe function
1 parent 0a8ffc9 commit 7d531a4

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,15 @@ E.g. dedupe([1, 2, 1]) returns [1, 2]
1616
// Given an empty array
1717
// When passed to the dedupe function
1818
// Then it should return an empty array
19-
test.todo("given an empty array, it returns an empty array");
19+
test("given an empty array, it returns an empty array", () => {
20+
expect(dedupe([])).toEqual([]);
21+
});
2022

2123
// Given an array with no duplicates
2224
// When passed to the dedupe function
2325
// Then it should return a copy of the original array
2426

2527
// Given an array of strings or numbers
2628
// When passed to the dedupe function
27-
// Then it should return a new array with duplicates removed while preserving the
29+
// Then it should return a new array with duplicates removed while preserving the
2830
// first occurrence of each element from the original array.

0 commit comments

Comments
 (0)