2

I have several tests generating coverage reports with istanbul. One of them is generated by karma-coverage plugin. I am merging these reports with istanbul report but files from karma-coverage report are not included in the merged report.

There was an issue with file paths that had the same symptoms but it seems to have been fixed: https://github.com/karma-runner/karma-coverage/pull/163

So it is probably something else.

I have tried using grunt-istanbul that instruments source files separately and then I browserify them in the bundle. I also tried using preprocessor from karma-coverage plugin to instrument the bundle. In both cases karma-coverage generates reports that look ok, but in both cases these reports are not included in the merged report.

What am I doing wrongly here? Is there some workaround maybe?

Package versions:

"karma": "^0.13.10",
"karma-coverage": "^0.5.2",
"grunt-istanbul": "^0.6.1"

karma.conf.js

reporters: ['coverage', 'spec'],
coverageReporter: {
  type: 'lcov',
  dir: 'coverage'
}
esp
  • 7,314
  • 6
  • 49
  • 79

2 Answers2

1

Coverage reporter should have type: 'lcov' - then you can merge reports

esp
  • 7,314
  • 6
  • 49
  • 79
1

If you are able to generate coverage separately then you can merge them as specified here: link

Kazmoda
  • 11
  • 2
  • 1
    Welcome to Stack Overflow! Whilst this may theoretically answer the question, [it would be preferable](//meta.stackexchange.com/q/8259) to include the essential parts of the answer here, and provide the link for reference. – Anton Menshov Apr 11 '20 at 03:07