-
Notifications
You must be signed in to change notification settings - Fork 63
Sourcemaps not tracing back to the source #73
Comments
Getting impacted by this issue currently. Any timeline on a possible fix? |
This is preventing me from getting proper coverage output in unional/domture#9 |
Any updates on this issue? Thanks. |
@d3viant0ne Hi Joshua, Being a fan of your thoughtful work, kindly let me encourage you to re-evaluate this issue. From my point of view it is less an inconvenience and more a reduction of this good middleware‘s use to the lowest possible grade - at least in Angular-CLI-instrumented TS projects. Is it possible for you to give this a push? Thanks greatly for reconsidering! Edit: I greatly overexaggerated. It is more like turning a sniper rifle into a shotgun. |
Any updates? This blocks coverage in SonarQube for Angular with the normal setup, since SonarQube needs the generated LCOV file's line numbers to match the TS source files. |
Here's an attempt at fixing it: https://github.com/adamburgess/istanbul-instrumenter-loader/commit/70355d4a578f330b7e24b207b4573ddd9f2a9388#diff-1fdf421c05c1140f6d71444ea2b27638 (lots of changes in this diff because I upgraded webpack/dependencies which were quite old, but the actual changes linked are very small) istanbul-instrumenter-lib doesn't use the sourcemap as an input, it just adds it to the output file. In my projects, stack traces now have correct line numbers. |
Are you planning to open a PR for that? |
it's been almost a year since a functional change landed in this repo, so no, I'll just leave it as a separate repo. anyone else can take the changes and do what they want with them, of course. |
Some people would still appreciate a PR for visibility. Some community members might be able to give feedback on it. If there are enough PRs that noone is merging we should join efforts on one fork. Or just get the repo more people with write access. |
Added a PR based on the work by @adamburgess at #73 (comment). @michael-ciniawsky @d3viant0ne WDYT of this fix? |
I created a new npm package named coverage-istanbul-loader. It includes the fix mentioned above as well as other fixes and updated dependencies. |
The sourcemaps that
istanbul-instrumenter-loader
returns are not using the input sourcemap to provide sourcemaps back to the source.This can be reproduced in the tests for this repo.
'sourcemap files on by default'
test intest/index.test.js
to print the sources content:npm run test
tests/fixtures/basic.js
):I tried tracing this around for a bit and couldn't find where it goes wrong, but it seems that the instrumenter is receiving the input sourcemap but
instrumenter.lastSourceMap()
isn't a sourcemap back to the source.The text was updated successfully, but these errors were encountered: