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 doesn't seem to capture the error... #5018
Comments
https://facebook.github.io/jest/docs/en/tutorial-async.html#rejects Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions. Thank you :) |
I'm raising it as a bug because I would expect the |
What happens if you make the surrounding |
Nothing different happens. The only way to get this to work is to do:
|
This issue is easier to find than the relevant Stack overflow question: https://stackoverflow.com/questions/50807170/jest-test-fails-when-trying-to-test-an-asynchronous-function-throws Example production code:
example test code:
|
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 am doing this:
but this throws an error in the terminal:
Is this simply a case of node capturing the error before Jest does?
The text was updated successfully, but these errors were encountered: