-
-
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
make throwingMatcher test n arguments (currently zero or one) #7000
Comments
You can create a custom matcher for this, or get it into jest-extended, cc @mattphillips Not sure we need it in core? |
@SimenB, this was actually proposed there already. I've started implementing some of it but I've been terribly busy at work so I haven't had the time to submit a PR there. Refer to jest-community/jest-extended#157. But if @ericprud is comfortable with working on it that would be cool as well. |
Yup this should be available in jest-extended soon so not sure we need it in core when we currently have |
Ah perfect. This is apparently a duplicate of #3659 as well, so closing 🙂 |
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. |
🚀 Feature Proposal
Make throwingMatcher test all arguments.
Motivation
Chai's throw takes multiple arguments to test error type and message.
Jest users who wish to test both of these traits must catch the error and manually perform both tests.
It would be trivial to make throwingMatcher's processResults apply each arg in turn:
Example
would fail with:
Pitch
The text was updated successfully, but these errors were encountered: