-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
Clear and concise description of the problem
As a developer using Vitest I want to be able to use test.each in a way that helps me to understand what tests are breaking without losing some of the description.
I am using test cases via test.each to reduce the amount of test boilerplate code.
However when using $description I am getting only a truncated version of the text, which doesn't help determine which test is breaking.
Each test case object has expected: ReturnType<Fn> and description: string properties;
describe('getTimelineRange', () => {
test('throws error when there are no rows', () => {
expect(() => getTimelineRange([])).toThrowError();
});
test.each(getTimelineRangeCases)('$description', ({rows, expected}) => {
expect(getTimelineRange(rows)).toEqual(expected);
});
});
I am getting this as my test output:
I'd prefer to get the full description, instead of a truncated version.
Suggested solution
Could a setting be exposed to disable or set the truncation size?
Alternative
For now I am considering either:
or
Returning the entire object as a string via %s -> test.each(getTimelineRangeCases)('%s', ({rows, expected}) => {

Additional context
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that request the same feature to avoid creating a duplicate.

