DEV Community

Discussion on: Simplify repetitive Jest test cases with test.each

Collapse
 
makaveli1313 profile image
makaveli1313

Thank you, so much easier to understand then in the docs!

Collapse
 
makaveli1313 profile image
makaveli1313

Any idea of how to use just the second argument in the text?
"given %p and %p as arguments, returns %p",

Collapse
 
nonary profile image
Nonary

You'll have to use both of them, but the convention is if you're not using a parameter you should name it a single underscore _

Collapse
 
targumon profile image
Amnon Sadeh • Edited
  1. Change the order of the arguments so the previously second becomes first.
  2. Use the "Tagged Template Literal" variant as described in the docs: jestjs.io/docs/en/api#testeachtabl...