esp
esp

Reputation: 7687

Merge istanbul test coverage from karma-coverage with coverage from other sources

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'
}

Upvotes: 2

Views: 1794

Answers (2)

Kazmoda
Kazmoda

Reputation: 11

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

Upvotes: 1

esp
esp

Reputation: 7687

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

Upvotes: 1

Related Questions