Skip to content

Commit b8b0a46

Browse files
committed
test case checks that result is valid and is a copy
1 parent ef50a58 commit b8b0a46

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

Sprint-1/implement/dedupe.test.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ test("array with no duplicates returns copy of original", () => {
3232
// Then it should return a new array with duplicates removed while preserving the
3333
// first occurrence of each element from the original array.
3434
test("removes duplicates, while preserving first occurrance of each element", () => {
35-
expect(dedupe([1, 3, 3, "as", "as", "df"])).toEqual([1, 3, "as", "df"]);
35+
const inputArr = [1, 3, 3, "as", "as", "df"];
36+
expect(dedupe(inputArr)).toEqual([1, 3, "as", "df"]);
37+
expect(dedupe(inputArr)).not.toBe(inputArr);
3638
});
3739

3840
// Given an array where all elements are the same

0 commit comments

Comments
 (0)