Closed exoego closed 2 months ago
Generate multiple coverage files in Vitest with v8 provider or istanbul provider.
Looks like your coverage data is provided by Vitest, it's not the data format (raw report) which can merge with MCR
You should try nyc
cause Vitest will convert V8 data to Istanbul.
If you want to merge raw V8 coverage data, such as merging coverage of Vitest's unit test and Playwright's e2e test, see this example: https://github.com/cenfun/merge-code-coverage-vitest
Using vitest-monocart-coverage will make Vitest work with MCR
Thanks for quick response. Oops, I should read README carefully. I'll test that and update this issue.
Describe the bug Coverage merger aborts due to
Cannot convert undefined or null to object
thrown inmonocart-coverage-reports/lib/istanbul/istanbul.js
To Reproduce
v8
provider oristanbul
provider.node coverage-merge.mjs
Expected behavior Coverage files are merged then a new single coverage is reported
Errors or Screenshots
Make a minimal reproduction
Additional context
vitest
1.6.0@vitest/coverage-v8
1.6.0@vitest/coverage-istanbul
1.6.0