Skip to content

Commit ad9af40

Browse files
author
Pretty Taruvinga
committed
Update dedupe test to use fixed expected values and check input immutability
1 parent a548d71 commit ad9af40

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Sprint-1/implement/dedupe.test.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,11 @@ test("Given an array with no duplicates, when passed to the dedupe function, the
3636
const input = ["a", "b", "c"];
3737
const result = dedupe(input);
3838

39-
expect(result).toEqual(input);
39+
const expected = ["a", "b", "c"];
40+
41+
expect(result).toEqual(expected);
4042
expect(result).not.toBe(input);
41-
expect(result.length).toBe(input.length);
43+
expect(input).toEqual(expected);
4244
});
4345

4446
// Given an array of strings or numbers

0 commit comments

Comments
 (0)