@tracecov/jest
v0.23.4
Published
Multi-file OpenAPI coverage reporting for Jest.
Maintainers
Readme
@tracecov/jest
Multi-file OpenAPI coverage reporting for Jest.
Jest runs each test file in its own worker, so a single coverage map never sees every file's
requests. This package collects each worker's fetch interactions and merges them into one
report at the end of the run. Self-contained CommonJS — no --experimental-vm-modules, works
on Jest 29 and 30.
Installation
npm install -D @tracecov/jestQuick Start
// jest.config.js
module.exports = {
setupFilesAfterEnv: ['./tracecov.setup.js'],
reporters: [
'default',
['@tracecov/jest/reporter', { schema: 'openapi.json', report: { html: 'coverage.html' } }],
],
};// tracecov.setup.js
const { collectCoverage, instrumentFetch } = require('@tracecov/jest');
instrumentFetch(collectCoverage());Every fetch your tests make is recorded, merged across workers, and written to the configured
report(s) when the run ends. A thresholds breach sets a non-zero exit code.
