-
Notifications
You must be signed in to change notification settings - Fork 1.4k
No stack trace for exceptions in throws/notThrows #1372
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
Comments
Nice find! We're only setting the stack for promises / observables, and even then we ignore the stack from the error itself. See Line 168 in 2b9f291
We should fall back to If anybody wants to land a hand here that'd be great. |
As a simple workaround, I remove test(`Convert accelerator`, t => {
toKeyEvent(accelerator);
t.is('silly', 'silly');
})); I still not got the stack trace, but at least I can see the point in my code that throwed: The "silly" part is to avoid |
I think a useful fix for this would be a flag or function to instruct ava to not clean the stack. If I get an error and can't figure out why, it would be great to do something like |
The We're looking for the following solution:
This refers to the |
Is this going to be fixed before 1.0? I'm evaluating whether to use ava for a new project, it's a bit uncomfortable to to manually edit failing tests to see the stack traces. |
@norbertkeri it's not on the priority list, no. That said the aforementioned refactor has landed so if you'd like to help out with a PR, we can get it in 😉 |
@issuehuntfest has funded $80.00 to this issue. See it on IssueHunt |
@dflupu has submitted a pull request. See it on IssueHunt |
@sindresorhus has rewarded $72.00 to @dflupu. See it on IssueHunt
|
Description
When a test fails due to a t.notThrows throwing or a t.throws throwing the wrong type of exception, there is no stack trace in the output, only the
toString
representation of the error. This makes it hard to debug such issues.Test Source
Output:
As shown here, only the last case prints a stack trace. I would like to see a similar output for the other two cases.
Environment
The text was updated successfully, but these errors were encountered: