Enable coverage in Jest itself and choose its collection provider explicitly.

Should unimported files affect the result? Which ignore comments does your provider recognize? Jest exposes scope, output and thresholds directly. This setup does not need a second nyc wrapper.
Keep coverage options in Jest
This CommonJS fragment assumes an existing passing suite and application JavaScript under src. Merge the keys into your project's configuration.
jest.config.cjs (merge into existing config)
module.exports = {
coverageProvider: 'babel',
collectCoverageFrom: [
'src/**/*.{js,cjs}',
'!src/**/*.test.js',
'!src/**/*.test.cjs'
],
coverageReporters: ['text', 'html', 'lcovonly'],
coverageThreshold: {
global: {
statements: 85,
branches: 80,
functions: 85,
lines: 85
}
}
};package.json (script fragment)
{
"scripts": {"coverage": "jest --coverage"}
}These limits illustrate a policy; they are not universal targets. Negated scope patterns follow the positive pattern because Jest applies them in order. Setting collectCoverageFrom does not enable collection alone; this command supplies --coverage.
Choose babel or v8 intentionally
Jest documents babel and v8 providers. The Babel provider recognizes Istanbul ignore hints; the V8 provider uses c8 hints. An Istanbul-style HTML report does not identify which provider collected the data.
When changing providers, inspect a representative branch and any ignored code before comparing totals. Keep provider, transform and scope settings with the tests.
Inspect files, then missing paths
First review the file list. An unimported application file should contribute when it matches collectCoverageFrom. Then inspect missing branches and choose inputs with meaningful assertions. Threshold enforcement can fail after all assertions pass.
| Symptom | Check |
|---|---|
| Unknown coverage or 0/0 | The source glob and project root. |
| No terminal summary | Include text or text-summary in coverageReporters. |
| Ignore hint has no effect | Provider and comment syntax. |
| Assertions pass; process fails | Thresholds and missing coverage data. |
Replacing coverageReporters replaces Jest's default list. Keep a terminal reporter for readable CI totals. For tool selection across runners, see the integration guide.
Primary sources
Check official documentation against the tools installed in your project. These explanations and examples are independent.