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
The current type specification does not allow const or readonly arrays so the following works but does not include proper types inside test:
test.each([[1,["1"]],[2,["1","2"]],[3,["1","2","3"]],])("renders pagination for a total of %i pages",(total,expectedElements)=>{// total is typed as number | string[]// expectedElements is typed as number | string[]});
The quick-fix marking the input array as readonly does not typecheck:
// however each does not accept readonly tuplestest.each([[1,["1"]],[2,["1","2"]],[3,["1","2","3"]],]asconst)("renders pagination for a total of %i pages",(total,expectedElements)=>{// total would be typed as 1 | 2 | 3// expectedElements is typed as ["1"] | ["1", "2"] ...});
Suggested solution
The following change to the EachFunction type will do the trick:
Clear and concise description of the problem
The current type specification does not allow const or readonly arrays so the following works but does not include proper types inside test:
The quick-fix marking the input array as readonly does not typecheck:
Suggested solution
The following change to the
EachFunction
type will do the trick:Alternative
No response
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: