Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Remap is not working properly when using source map files from webpack #68
This issue is most likely related to other similar issues I've seen in your queue. I wanted to log it to hopefully provide a bit more info to give some more use cases. We are trying to use Webpack to build typescript and then test with karma and then use remap to show coverage on our typescript.
Using 0.6.4 of remap poses issues in doing so. Here is a sample repo that will demonstrate the issue: https://github.com/matt-schrader/typescript_code_coverage
I have made changes on my box to make it work for me. I'll post those changes, but by no means am I recommending them as solutions as I'm not sure they are correct for the community. The changes I made are after the //MATT comment.
First run the build
The last the step should give an error like
To fix this I changed node_modules/remap-istanbul/node_modules/istanbul/lib/report/html.writeFiles to be:
Then I ran into an issue where the links and style includes from the html reports were incorrect. The links included a '/' and the style includes had an extra '../' causing the source code coverage to not work at all. To fix this I changed node_modules/remap-istanbul/node_modules/istanbul/lib/report/html.cleanPath to be
After these two changes I am seeing coverage properly.
referenced this issue
Jun 22, 2016
Unfortunately this issue is not fixed by this merge. I looked into this a bit more today and I think the real culprit to this is the paths resulting from webpack sourcemaps including webpack:///app.ts in front of each file name. webpack:// get stripped off and we are left with /app.ts. So, Istanbul/remap can't write the report.
I plan on looking into a better fix for this particular issue as I have time.
referenced this issue
Sep 7, 2016
Yes, check out my sample project: https://github.com/matt-schrader/typescript_code_coverage. The use of that is in the webpack.test.config.js file. Let me know if that helps.