Using “table” in method it.each of Jest
test.each`table`(name, fn, timeout)
1
2
3
4
5
6
7
| it.each`
a | b | result
${1} | ${2} | ${3}
${0} | ${4} | ${4}
`("should return $result when a = $a, b = $b", ({ a, b, result }) => {
expect(sum(a, b)).toBe(result);
});
|