webpack-contrib / istanbul-instrumenter-loader

Istanbul Instrumenter Loader
MIT License
273 stars 65 forks source link

Sourcemap support for TypeScript -> Webpack -> Karma Coverage -> Karma Remap Coverage? #35

Closed ClemensSchneider closed 7 years ago

ClemensSchneider commented 7 years ago

Over at https://github.com/AngularClass/angular2-webpack-starter switching from istanbul-instrumenter-loader 0.2.0 to 1.0.0 broke the remapping of the coverage-report to the originating TypeScript sources. Is this a known issue with 1.0.0 or is there anything else to be considered to get this working again?

See https://github.com/AngularClass/angular2-webpack-starter/issues/1117

MichaReiser commented 7 years ago

This is going to work if #29 is merged together with SitePen/remap-istanbul#87 (using it myself in the build chain)

It will not be supported without remap istanbul since karma is still using old istanbul version. Karma needs to output json reports that are than remapped. See MichaReiser/parallel.es karma.conf.js, package.js

MichaReiser commented 7 years ago

Both branches are merged and your setup should now be supported if using latest versions.

The only thing now missing is the release of remap-istanbul... hopefully this one will be soon

ecozoic commented 7 years ago

I'm still getting this error.

Error: Could not find source map for: "C:\git\angular2-starter\src\app\app.component.ts"
    at CoverageTransformer.addFileCoverage (C:\git\angular2-starter\node_modules\remap-istanbul\lib\CoverageTransformer.js:134:15)
    at C:\git\angular2-starter\node_modules\remap-istanbul\lib\CoverageTransformer.js:254:12
    at Array.forEach (native)
    at CoverageTransformer.addCoverage (C:\git\angular2-starter\node_modules\remap-istanbul\lib\CoverageTransformer.js:252:30)
    at C:\git\angular2-starter\node_modules\remap-istanbul\lib\remap.js:38:9
    at Array.forEach (native)
    at remap (C:\git\angular2-starter\node_modules\remap-istanbul\lib\remap.js:37:12)
    at C:\git\angular2-starter\node_modules\remap-istanbul\lib\remap-istanbul.js:146:19
    at process._tickCallback (internal/process/next_tick.js:103:7)
    at Module.runMain (module.js:606:11)

awesome-typescript-loader@2.2.4 remap-istanbul@0.8.0 istanbul-instrumenter-loader@1.1.0

Using inline source maps. Works w/ istanbul-instrumenter-loader@0.2.0 but breaks on the upgrade (even w/ new remap-istanbul).

You can repro it on the develop branch in this repo: https://github.com/ecozoic/angular2-starter/tree/develop

EDIT - I found this post in another thread: https://github.com/SitePen/remap-istanbul/issues/96. Issue was setting the source map options in my webpack.test.config.js. Removing them seems to have fixed the issue. Thanks!

MichaReiser commented 7 years ago

Good to here... Can we close this issue?