1const add = (a, b) => a + b;
2
3const cases = [[2, 2, 4], [-2, -2, -4], [2, -2, 0]];
4
5describe("'add' utility", () => {
6 test.each(cases)(
7 "given %p and %p as arguments, returns %p",
8 (firstArg, secondArg, expectedResult) => {
9 const result = add(firstArg, secondArg);
10 expect(result).toEqual(expectedResult);
11 }
12 );
13});
14
15