-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
assertion message includes Error
name, but does not match on it
#6688
Comments
Stripping out |
Makes sense to me, @mullen3 interested in putting in your first Jest PR? |
Thanks @SimenB and @rickhanlonii. Which solution do we think is better? |
I think as @SimenB said we should strip out the name from the test failure report |
It seems like this issue has been resolved in #7621 |
Yup, that should fix it |
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. |
🐛 Bug Report
Not sure if this is necessarily a bug, but definitely a footgun/confusing message. When expecting a function
toThrow
, jest outputs theError
name in the test failure message, but does not actually match on the name. Like this:To Reproduce
https://repl.it/repls/IroncladCreativeForm
Expected behavior
Either match on the name as well as the message, or strip out the name from the test failure report.
The text was updated successfully, but these errors were encountered: