You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test("Given an empty array, when passed to the dedupe function, then it should return an empty array",()=>{
20
17
expect(dedupe([])).toEqual([]);
21
18
});
22
19
23
-
// Given a non-array value
24
-
// When passed to the dedupe function
25
-
// Then it should return null
26
20
test("Given a non-array value, when passed to the dedupe function, then it should return null",()=>{
27
21
expect(dedupe("not an array")).toBeNull();
28
22
expect(dedupe(123)).toBeNull();
29
23
expect(dedupe({})).toBeNull();
30
24
});
31
25
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
35
26
test("Given an array with no duplicates, when passed to the dedupe function, then it should return a copy of the original array",()=>{
36
27
constinput=["a","b","c"];
37
28
constcopyOfInput=["a","b","c"];
@@ -43,9 +34,6 @@ test("Given an array with no duplicates, when passed to the dedupe function, the
43
34
expect(input).toEqual(copyOfInput);
44
35
});
45
36
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
49
37
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",()=>{
0 commit comments