Add a reason parameter in expect
MisterLight opened this issue · comments
Gia commented
Clear and concise description of the problem
Just a little message can help to document the thing under test, thats why in some testing libraries is possible to supply a custom message for a given expectation.
Coming from Jest I was capable of doing this thanks to this library:
But I think it would be great if vitest come with it natively
Suggested solution
Using the same code from the mentioned library before:
test('returns 2 when adding 1 and 1', () => {
expect(1 + 1, 'Woah this should be 2!').toBe(3);
});
Alternative
No response
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.
Vladimir commented
It already has one.