Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a reason parameter in expect #5645

Closed
4 tasks
MisterLight opened this issue Apr 30, 2024 · 1 comment
Closed
4 tasks

Add a reason parameter in expect #5645

MisterLight opened this issue Apr 30, 2024 · 1 comment

Comments

@MisterLight
Copy link

MisterLight commented Apr 30, 2024

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:

jest-expect-message

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

@sheremet-va
Copy link
Member

It already has one.

@github-actions github-actions bot locked and limited conversation to collaborators May 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants