Code-coverage using v8's Inspector that's compatible with Istanbul's reporters.
Like nyc, c8 just magically works, simply:
npm i c8 -g
c8 node foo.jsThe above example will collect coverage for foo.js using v8's inspector.
TODO:
-
write logic for converting v8 coverage output to Istanbul Coverage.json format.
-
talk to Node.js project about silencing messages:
Debugger listening on ws://127.0.0.1:56399/e850110a-c5df-41d8-8ef2-400f6829617f. -
figure out why
detailedmode does not appear to be working.- this is fixed in v8, as long as you start with
--inspect-brkyou can collect coverage in detailed mode.
- this is fixed in v8, as long as you start with
-
figure out a better way to determine that all processes in event loop have terminated (except the inspector session).
-
process.exit() can't perform an async operation; how can we track coverage for scripts that exit?
- we can now listen for the
Runtime.executionContextDestroyedevent.
- we can now listen for the
-
figure out why instrumentation of .mjs files does not work:
- see: nodejs/node#17336