-
-
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
Better stack traces in asynchronous errors #5104
Comments
For completeness, what I want as stack for all of those are:
|
Same here: #5902 |
Opened up #6008. Combined with #5997 I think that covers all cases reported here except for |
For those following along, a new alpha is out: |
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. |
Do you want to request a feature or report a bug?
Feature
What is the current behavior?
There are three cases (that I know of) when a test is failing, and we don't point back to the user's own code.
This renders the following errors:
If the current behavior is a bug, please provide the steps to reproduce and
either a repl.it demo through https://repl.it/languages/jest or a minimal
repository on GitHub that we can
yarn install
andyarn test
.See above.
What is the expected behavior?
For the stack trace to point back to the failing test. In the first case, I would expect it to point to the line of the
expect
, and in the the two other cases, to the lines specifyingassertions
.I think the only way to achieve this is to somehow store an error whenever those functions are resolved, and use its stack on failure, instead of creating a new
Error
within Jest itself on failure. As long as we don't inspect the stack trace (unless we need it for an error), the overhead should be minimal.If we get a good stack trace, we automatically get the codeframe as well.
Please provide your exact Jest configuration and mention your Jest, node,
yarn/npm version and operating system.
[email protected], [email protected]
The text was updated successfully, but these errors were encountered: