Skip to content

Commit c1b088d

Browse files
author
Pretty Taruvinga
committed
Improve dedupe test to check immutability and order
1 parent ad01a87 commit c1b088d

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

Sprint-1/implement/dedupe.test.js

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,16 @@ E.g. dedupe([1, 2, 1]) returns [1, 2]
1313

1414
// Acceptance Criteria:
1515

16-
// Given an empty array
17-
// When passed to the dedupe function
18-
// Then it should return an empty array
1916
test("Given an empty array, when passed to the dedupe function, then it should return an empty array", () => {
2017
expect(dedupe([])).toEqual([]);
2118
});
2219

23-
// Given a non-array value
24-
// When passed to the dedupe function
25-
// Then it should return null
2620
test("Given a non-array value, when passed to the dedupe function, then it should return null", () => {
2721
expect(dedupe("not an array")).toBeNull();
2822
expect(dedupe(123)).toBeNull();
2923
expect(dedupe({})).toBeNull();
3024
});
3125

32-
// Given an array with no duplicates
33-
// When passed to the dedupe function
34-
// Then it should return a copy of the original array
3526
test("Given an array with no duplicates, when passed to the dedupe function, then it should return a copy of the original array", () => {
3627
const input = ["a", "b", "c"];
3728
const copyOfInput = ["a", "b", "c"];
@@ -43,9 +34,6 @@ test("Given an array with no duplicates, when passed to the dedupe function, the
4334
expect(input).toEqual(copyOfInput);
4435
});
4536

46-
// Given an array of strings or numbers
47-
// When passed to the dedupe function
48-
// Then it should remove the duplicate values, preserving the first occurrence of each element
4937
test("Given an array with strings or numbers, when passed to the dedupe function, then it should remove the duplicate values, preserving the first occurrence of each element", () => {
5038
expect(dedupe(["a", "a", "b", "c", "c"])).toEqual(["a", "b", "c"]);
5139
expect(dedupe([1, 2, 2, 3, 4, 4])).toEqual([1, 2, 3, 4]);

0 commit comments

Comments
 (0)