Skip to content

Commit c4200ce

Browse files
committed
add test case where all elements are the same
1 parent 98b044c commit c4200ce

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Sprint-1/implement/dedupe.test.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,9 @@ test("array with no duplicates returns copy of original", () => {
3333
test("removes duplicates, while preserving first occurrance of each element", () => {
3434
expect(dedupe([1, 3, 3, "as", "as", "df"])).toEqual([1, 3, "as", "df"]);
3535
});
36+
37+
// Given an array where all elements are the same
38+
// When passed to the dedupe function
39+
// Then it should return an array with that single element
40+
test("when all items are same, return array containing one single one of that item", () => {});
41+
expect(dedupe(["a", "a", "a", "a"])).toEqual(["a"]);

0 commit comments

Comments
 (0)