Best practices
For new test setups, prefer native coverage collection without an instrumentation step:
Node.js
Recommended setup: Node.js native test runner + mcr test.
node:test runs assertions; MCR automatically collects native V8 JavaScript coverage and generates reports.
See Run tests with mcr test for details.
Browser
Recommended setup: Playwright Test + MCR.
Playwright runs assertions; automatic fixtures collect Chromium JS/CSS coverage; MCR merges it and generates reports.
See Playwright coverage collection and the automatic fixture example for setup details.
Integrated test reporting
For browser tests that need unified test and coverage reporting, use Playwright Test + monocart-reporter.
The reporter already integrates MCR; configure its coverage option and submit coverage from fixtures.
See the monocart-reporter coverage report guide for configuration details.
Further reading
For detailed setup instructions and examples, see the best-practices guide.