vitest-monocart-coverage
v2.1.2
Published
[![](https://img.shields.io/npm/v/vitest-monocart-coverage)](https://www.npmjs.com/package/vitest-monocart-coverage) [![](https://badgen.net/npm/dw/vitest-monocart-coverage)](https://www.npmjs.com/package/vitest-monocart-coverage) ![](https://img.shield
Downloads
25,927
Readme
Vitest Monocart Coverage
Generating native V8 coverage report for Vitest with Monocart coverage reports
Install
npm i vitest-monocart-coverage -D
Vitest Config
// vitest.config.js
import { defineConfig } from 'vitest/config';
export default defineConfig({
test: {
include: ['test/*.test.js'],
coverage: {
enabled: true,
include: ['src/**'],
provider: 'custom',
customProviderModule: 'vitest-monocart-coverage'
}
}
});
See Vitest custom coverage provider
Config file for Coverage Options
- mcr.config.js
- mcr.config.cjs
- mcr.config.mjs
- mcr.config.json
- mcr.config.ts
See config example mcr.config.js
// mcr.config.js
export default {
// logging: 'debug',
// provider: 'istanbul',
name: 'My Vitest Coverage Report',
reports: [
'console-details',
'v8'
],
lcov: true,
outputDir: 'coverage',
onEnd: (results) => {
console.log(`coverage report generated: ${results.reportPath}`);
}
};
See monocart-coverage-reports for more coverage options.