1

I have a Webpack setup which produces a bundle using both the webpack-dev-server and for production a file on disk. I have also got tests running with Karma. I want to add code coverage reports but it seems I have tried everything but cannot get it to work.

I am using karma-coverage to produce a JSON file which is then passed through remap-istanbul but this produces loads of

Error: Could not find source map for: "/vagrant/project/media/website/js/ng/xxxxxxxx.ts"

Essentially it can't find sourcemaps for any of the Typescript files which is correct because they aren't there; they are inline and in memory.

What is the correct way to generate accurate coverage reports for Typescript projects when using Webpack? (I am not precious about using Istanbul - I only picked it as it seems the most popular)

Rob
  • 14,746
  • 28
  • 47
  • 65
Robin Elvin
  • 1,207
  • 12
  • 28

0 Answers0