-
-
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
Inconsistency in rejects.toThrow()
#6675
Comments
It passes with the synchronous version, it's just @BetterCallSKY ideas? |
May be the test fails because |
Behavior for promises changed in #5670. My understanding of |
To be honest, |
@peterdanis |
I know, before #5670 even Therefore I've tried to check, whether object checked in the But does it make sense to check whether a promise "throws"? Normally one does not use |
This is also a problem when throwing objects in async/await that are not Error instances and expecting the
|
This issue is stale because it has been open for 1 year with no activity. Remove stale label or comment or this will be closed in 14 days. |
This issue was closed because it has been stalled for 7 days with no activity. Please open a new issue if the issue is still relevant, linking to this one. |
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
The doc says the argument of
toThrow()
can be a class for the error, it works when a promise throws anError
instance, but fails when the promise throws a custom object.To Reproduce
The first test passes, while the second test fails with the following message:
Expected behavior
Both the above two tests pass.
The text was updated successfully, but these errors were encountered: