Code-coverage using Node.js' build in functionality that's compatible with Istanbul's reporters.
Like nyc, c8 just magically works:
npm i c8 -g
c8 node foo.js
The above example will output coverage metrics for foo.js
.
run c8 report
to regenerate reports after c8
has already been run.
c8 uses
bleeding edge Node.js features,
make sure you're running Node.js >= 10.12.0
.
A fully functional code coverage solution using only V8's native coverage features and minimal user-land modules, so that we fit these constraints:
- No parsing of JavaScript code.
- No mucking with Node.js' runtime environment.
See the contributing guide here.