Skip to content

Commit a234c5a

Browse files
committed
Refactor dedupe test to store result in a variable for improved readability
1 parent 6378b4b commit a234c5a

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
@@ -26,9 +26,11 @@ describe("dedupe", () => {
2626
// Then it should return a copy of the original array
2727
test("should return a copy of the original array when there are no duplicates", () => {
2828
const input = [1, 2, 3];
29-
expect(dedupe(input)).toEqual(input);
3029

31-
expect(dedupe(input)).not.toBe(input);
30+
const result = dedupe(input);
31+
32+
expect(result).toEqual([1, 2, 3]);
33+
expect(result).not.toBe(input);
3234
});
3335

3436
// Given an array of strings or numbers

0 commit comments

Comments
 (0)