- Used jests
test.each
for the first time. The syntax is kinda confusing but I grokked it in the end.
The array of arrays passed is the variables and expected params for your test. The last item in the array is thetest.each([ [1, 1, 2], [1, 2, 3], [2, 1, 3], ])(".add(%i, %i)", (a, b, expected) => { expect(a + b).toBe(expected); });
expected
value . You can have any number of values before which represent the aruguments or conditions of your text.