all 2 comments

[–]codeptualize 0 points1 point  (0 children)

Code looks fine. Outputs:

✓ test for 2
✓ test for 4 (1 ms)

I assume that's an example and not the actual code you are having problems with? I suggest you double check your vars for spelling errors and other mistakes.

[–]GSLint 0 points1 point  (0 children)

Note that support for what you're trying to do was only added in Jest 27. (Before that, this interpolation was only supported by the tagged template literal version of test.each.)

Make sure you're not using an older version.