-
-
Notifications
You must be signed in to change notification settings - Fork 359
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
nyc makes stack traces unreadable #285
Comments
Yea, this is a known issue, although looking through the issue list it's not explicitly tracked. Code coverage works by transforming the original source code. Stack traces need to be translated in order to be accurate. nyc doesn't attempt to do this. It's tricky because AVA does and it's unclear how between the two of them stack trace conversion would interact. |
Could a sourcemap solve this? |
Yes, and I prototyped a solution in #217. I'm not entirely sure we can get source maps out of istanbul though, and I haven't had the time to research the interaction of multiple |
I see - sounds way more complicated than I thought.. |
see also: #137 |
CC: @gotwarlost it would be nice to consolidate Istanbul and nyc's source-map handling, and to address issues such as stack traces 💯 |
(Deleted prior comment) |
If you already use babel, one way to allow error stack traces to work with node-sourcemap-support is to use https://github.com/istanbuljs/babel-plugin-istanbul, and set nyc's "sourceMap" and "instrument" settings to false. |
closing in favor of #619. |
When adding nyc to my ava test runs I receive wrong file numbers in stack traces
as shown in the following examples:
Without nyc
returns:
With nyc
returns:
(my error was neither in line 9 nor in column 7575 but in line 137)
The text was updated successfully, but these errors were encountered: