Skip to content

Commit b58b9c2

Browse files
committed
add test to chack for array identity
1 parent 71b98b5 commit b58b9c2

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,10 @@ test("given an array with no duplicates, it returns a copy of the original array
3434
test("given an array of strings or numbers, it returns a new array with no duplicates removed", () => {
3535
expect(dedupe(['a','a','a','b','b','c'])).toEqual(['a','b','c']);
3636
expect(dedupe([5, 1, 1, 2, 3, 2, 5, 8])).toEqual([5, 1, 2, 3, 8]);
37-
});
37+
});
38+
39+
const original = [1, 2, 3];
40+
const result = dedupe(original);
41+
42+
expect(result).toEqual([1, 2, 3]);
43+
expect(result).not.toBe(original);

0 commit comments

Comments
 (0)