-
Notifications
You must be signed in to change notification settings - Fork 47
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
Maintain sourcemapping for injected modules. #10
Comments
This is a problem of istanbul-instrumenter-loader |
Thanks for reporting. This is an issue I'm aware of. I think to work up a fix I will need to reprocess the source maps if they are supplied. I'm on vacation for the next week or so, i plan to do a bunch of work on this stuff when I get back to work. ✌️ |
Just ran into exactly this problem. Anything I can do to help? |
Not to include same file with inject loader and without in the same build. This is usually an indication, some of your unit tests include too much. Though I made a dirty fix for istanbul-loader to address this (not accepted) |
Did anyone find a workaround for this? I've got inject-loader working just fine, the coverage report still just reports tested lines as untested still. |
To be honest I’m pretty out of my depth here — I know very little about the implementation details of sourcemaps. Anyone have any useful pointers on how to resolve this? I’m making some improvements to |
Hi guys, |
@ricardolpd Looked into it, yes. But no solution—still an open issue. |
I've added sourcemaps support in #36. Could someone give it a try? |
Fixed by #36 |
@vladimir-tikhonov thanks for adding support for sourcemaps. I am using webpack 2.x + mocha, in vs code with node v7.5.0. I would love to have this working so i am happy to keep debuging as much as possible, to see if this is a config issue on my side or something else, that could probably help down the line. |
@ricardolpd are you sure that this issues are caused by |
@vladimir-tikhonov, yes i agree with you, sourcemaps and webpack are not amazing:(. But yeah i think i am pretty sure its caused by inject-loader. Also i am using node debugger with vscode, the only sourcemaps that work with vscode and webstorm (tools used at work, is the 'source-map', nothing else). |
I am not 100% which side is the best to resolve this issue since there are multiple plugins involve. However, I do want to report this so the maintainer and other users are aware of this problem.
First, our setup is:
The istanbul-instrumenter-loader was used to hook each module to Istanbul.
Now, when test package requires both a module, and an injected version of the same module. I'm getting exceptions from Istanbul. On the surface, the issue is caused by a mismatch between
statements
andstatementMap
, two internal variables of Istanbul to record statements and the location of them in the file. The length of the two didn’t agree. One recorded more statements than the other for "the same file".I did some debugging and I believe this is what's happening:
The two functions, under the same name, have different statement count, led to the issue.
I also provided this info to Istanbul under gotwarlost/istanbul#192.
The text was updated successfully, but these errors were encountered: