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
Allow the test.each test name to format inputs of variable length cleanly. Allow for the previous behavior to be re-enabled or add a special operator that uses Array.join() behind the scenes.
Motivation
test.each can support inputs of varying length if the test function makes the uses of the spread operator (...). However, there's no good way to format the test name such that each test includes all of the arguments. #6342 disabled the default util.inspect behavior that would have allowed for this.
Example
Proposal 1:
it.todo.each ([
['Red', 'Blue'],
['Purple', 'Yellow', 'Green'],
]) ('Looks good with the following colors: ');
Looks good with the following colors: Red Blue
Looks good with the following colors: Purple Yellow Green
Proposal 2:
it.todo.each ([
['Garlic', 'Smashed', 'Chopped'],
['Beef', 'Sliced', 'Salted', 'Grilled'],
]) ('%s can be prepared in the order %a{ -> }');
Garlic can be prepared in the order Smashed -> Chopped
Beef can be prepared in the order Sliced -> Salted -> Grilled
The text was updated successfully, but these errors were encountered:
This issue was closed because it has been stalled for 7 days with no activity. Please open a new issue if the issue is still relevant, linking to this one.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.
🚀 Feature Proposal
Allow the
test.each
test name to format inputs of variable length cleanly. Allow for the previous behavior to be re-enabled or add a special operator that usesArray.join()
behind the scenes.Motivation
test.each
can support inputs of varying length if the test function makes the uses of the spread operator (...
). However, there's no good way to format the test name such that each test includes all of the arguments. #6342 disabled the defaultutil.inspect
behavior that would have allowed for this.Example
Proposal 1:
Proposal 2:
The text was updated successfully, but these errors were encountered: