jest-monocart-coverage
v1.1.1
Published
Jest Monocart Coverage Reports
Downloads
15,886
Readme
jest-monocart-coverage
A Jest custom reporter for monocart coverage reports
Install
npm i jest-monocart-coverage
Usage
// jest.config.js
const config = {
// Enable coverage
collectCoverage: true,
// Recommended to use `v8` to support the generation of native v8 coverage reports.
coverageProvider: 'v8',
// Monocart can also support all coverage reports, so there is no need to set up reports here.
coverageReporters: ['none'],
reporters: [
// If custom reporters are specified, the default Jest reporter will be overridden. If you wish to keep it, 'default' must be passed as a reporters name:
'default',
// Monocart custom reporter to generate coverage reports.
['jest-monocart-coverage', {
name: 'My Unit Coverage Report',
reports: [
['v8'],
['console-summary'],
['lcovonly']
],
outputDir: './coverage-reports/unit'
}]
]
};
export default config;
Check monocart coverage reports for more coverage options.
The Execution Order of Hooks
- For Jest: custom reporter
onEnd
->globalTeardown
- For Playwright:
globalTeardown
-> coverageonEnd
-> custom reporteronEnd