-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
.toThrow() to match both error constructor and message? #3659
Comments
Please feel free to implement your own matcher with this feature using |
Is this still the official position? I find myself wanting to do this, but without #6243 it's not really possible to overload the behavior of |
Yeah, I think so. You can probably get it added to jest-extended, if you want. |
@Nevon I've just opened up this issue in jest-extended to add this matcher if you want to help out by sending a PR 👍 |
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. |
I want to request a feature.
What is the current behavior?
Currently
.toThrow()
can match error constructor or message, but not both: demoInstead, I have to do it like this: demo
What is the expected behavior?
Is it possible
.toThrow()
can be refactored to match both error constructor and message at the same time, if message is provided?The text was updated successfully, but these errors were encountered: