There is no way of retrieving the code coverage report programmaticaly
For the development of our JS Mutation testing framework stryker we want to programmatically receive the code coverage report. We're using karma via the public api.
Right now: we have 2 issues:
- We do not know when the coverage report has been written.
- We need to collect the coverage report from disk.
I want to add a new feature: 2 birds with one stone.
I want to raise an event called coverage_complete whenever the reporter is done with a coverage report. In order to do that, i want to add the emitter as inject-able in reporter.js.
Next, i want to add a new reporter type: inMemory or something. When that reporter is active, it will provide the result of collector.getFinalCoverage() to the coverage_complete event. I don't want to add the report to every event throw, because of possible performance overhead. Only when the inMemory report type is in the list.
@dignifiedquire do you agree with this approach?
Sounds good to me.