Skip to content

Commit e7602ab

Browse files
committed
Added test to check if return value is a copy of the original array in dedupe.test.js
1 parent a2029d9 commit e7602ab

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Sprint-1/implement/dedupe.test.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,11 @@ describe("dedupe", () => {
4343
it(`returns the deduped array for [${input}]`, () =>
4444
expect(dedupe(input)).toEqual(expected))
4545
);
46+
47+
it("returns a copy not the original array", () => {
48+
const input = [1, 2, 3];
49+
const result = dedupe(input);
50+
expect(result).toEqual(input);
51+
expect(result).not.toBe(input);
52+
});
4653
});

0 commit comments

Comments
 (0)