I have a CI running that does mocha test executions in parallel. A test execution creates a coverage report coverage.json
- generated by nyc
. I want to have a final merged report from all of the coverage.json
s in lcov format, but I can't manage to generate one - I always end up having an empty text summary. What I've tried:
- Running
nyc report
:
nyc report --temp-dir=nyc/coverage_dir --reporter=text --reporter=lcov
gives an empty report and text summary
- First running
nyc merge
and thennyc report
nyc merge ./coverage_dir coverage.json
nyc report --report-dir=temp --reporter=text --reporter=lcov
This combination does seem to merge the coverage.jsons files, at least judging from the file size, but the report
step still displays an empty text summary.
- Trying the above with different version, i.e.
nyc 15.1.0
andnyc 14.1.1
- Specifying the
-t
flag and--report-dir
options outlined in this answer - Changing to a parent directory and rerunning the commands as specified by this answer.
All resulting in an empty text summary of the final report.
FYI, there is now a section in nyc doc about it: combining-reports-from-multiple-runs