Skip to content

Commit 760695c

Browse files
committed
adding restriction on the test
1 parent 51e3a0b commit 760695c

File tree

1 file changed

+3
-16
lines changed

1 file changed

+3
-16
lines changed

Sprint-1/implement/dedupe.test.js

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,29 +25,16 @@ test("given an empty array, it returns an empty array", () => {
2525
// Then it should return a copy of the original array
2626
test("The function should return a copy of the original array if the array contains no duplicates", () => {
2727
const original1 = [2, 4, 5, 6, 8];
28+
expect(original1.length).toBe(new Set(original1).size);
2829
const result1 = dedupe(original1);
2930
expect(result1).toEqual(original1);
3031
expect(result1).not.toBe(original1);
3132

32-
const original2 = [3, 7, 5, 8, 14, 19];
33+
const original2 = [3, 9, 25, 1, 12, 42];
34+
expect(original2.length).toBe(new Set(original2).size);
3335
const result2 = dedupe(original2);
3436
expect(result2).toEqual(original2);
3537
expect(result2).not.toBe(original2);
36-
37-
const original3 = ["apple", "banana", "milk", "egg"];
38-
const result3 = dedupe(original3);
39-
expect(result3).toEqual(original3);
40-
expect(result3).not.toBe(original3);
41-
42-
const original4 = [1, "apple", true, null, 99];
43-
const result4 = dedupe(original4);
44-
expect(result4).toEqual(original4);
45-
expect(result4).not.toBe(original4);
46-
47-
const original5 = [100, 200, 300, 400, 500];
48-
const result5 = dedupe(original5);
49-
expect(result5).toEqual(original5);
50-
expect(result5).not.toBe(original5);
5138
});
5239
// Given an array with strings or numbers
5340
// When passed to the dedupe function

0 commit comments

Comments
 (0)