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
{{ message }}
This repository has been archived by the owner on Sep 14, 2024. It is now read-only.
describe.each lets you pass in a table to parameterize any tests inside that describe block. Their example:
describe.each([
[1, 1, 2],
[1, 2, 3],
[2, 1, 3],
])('.add(%i, %i)', (a, b, expected) => {
test(`returns ${expected}`, () => {
expect(a + b).toBe(expected);
});
test(`returned value not be greater than ${expected}`, () => {
expect(a + b).not.toBeGreaterThan(expected);
});
test(`returned value not be less than ${expected}`, () => {
expect(a + b).not.toBeLessThan(expected);
});
});
For TestEZ, the format would probably need to be adapted a bit, and I don't like the idea of having describe() and describe.each() (describe is both a function and an object). Maybe describeEach() would fit our style better.
The text was updated successfully, but these errors were encountered:
Worth noting that you can just put a describe block inside a for loop and parameterize tests that way, so this would only be to reduce boilerplate/extra indents, and to better document the intention.
describe.each
lets you pass in a table to parameterize any tests inside that describe block. Their example:For TestEZ, the format would probably need to be adapted a bit, and I don't like the idea of having
describe()
anddescribe.each()
(describe is both a function and an object). Maybe describeEach() would fit our style better.The text was updated successfully, but these errors were encountered: