istanbul-js
Menu
Independent reference

Choose a coverage integration: nyc, Jest, tap or a browser bridge

Choose tools by collection ownership, then select a report format.

The coverage workflow separates running tests, collecting counters and rendering output.
Identify who owns collection: a wrapper, the runner, or a bridge from a browser or device.

Does the runner already collect coverage? Does code execute in Node, a browser or a device? Istanbul provides several libraries and reporters. Familiar HTML output does not imply that every integration inserts counters the same way.

Start with the runtime and runner

SetupCollection starting pointGuide
Mocha/CommonJSnyc wrapperMocha
AVA/compatible loadingnyc, verify workersAVA
JestJest providerJest
Current tapTap’s V8 collectiontap
InternIntern configurationIntern
Browser bundleTest build and export bridgewebpack
DeviceHost instrumentation, target exportIoT.js

For native ESM, check the collection route supported by installed tools. The official integration list includes c8, which uses V8 collection and Istanbul reports. Do not assume a CommonJS require hook covers native imports.

Keep responsibilities visible

Instrumentation or a runtime provider records execution. Collection persists data. Reporters turn compatible data into HTML, LCOV, text or another output. The Babel plugin inserts counters; it does not replace browser export or reporting.

Assign one owner to each step. Configure Jest when Jest owns collection. Disable a second instrumentation pass when Babel inserts counters. Retrieve browser data from the page context before teardown.

Verify the local handoff first

Inspect a known missed branch locally before adding an external coverage service. Compare source filenames and revisions in the artifact. That separates collection failure from downstream import and path-mapping problems.

This static reference performs no external upload when readers open its pages. Its commands are examples for your development environment.

Preserve meaning across migrations

When changing providers, compare scope, maps, ignored code and one representative decision. A changed percentage may reflect changed measurement. Choose report output after identifying what generated the data.

Primary sources

Check official documentation against the tools installed in your project. These explanations and examples are independent.