Start from the test runner you use, or go straight to the coverage task in front of you.
Tutorials by test runner
Each tutorial sets up coverage for one runner or build tool and shows how to read the first report.
- Mocha coverage with nyc: a working first report
- Jest coverage: use its provider, scope and thresholds
- AVA coverage: choose the source-loading setup first
- tap coverage today: V8 collection and Istanbul reports
- TypeScript coverage: preserve maps and choose one build path
- ES2015, Babel and native modules: coverage boundaries
- webpack coverage: collect from the browser build you test
- Intern coverage: scope, reporters and source locations
- IoT.js coverage: instrument on the host, collect on the target
Advanced coverage tasks
These notes cover thresholds, exclusions, instrumentation, child processes and report formats once basic coverage works.
- nyc thresholds and check-coverage: make the gate explicit
- nyc file scope: all, include, exclude and source maps
- Istanbul instrumentation: add counters without double processing
- nyc process trees and merging separate test runs
- Choose an Istanbul reporter: HTML, LCOV, JSON or text
- Turn an Istanbul coverage object into a report