You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 2, 2023. It is now read-only.
As a maintainer of NYC I'd like to ensure that we can provide coverage for ESM modules. For CJS modules by default we hook require.extensions, we also have the ability to hook vm.runInThisContext and vm.runInContext. In all of these methods we add instrumentat (coverage counters) to the code before passing it to the original method.
We need a similar ability to support native ESM. Currently to test ESM with nyc can only be done by having babel transpile to commonjs or by using --require esm.
Would it be possible for nyc to use the native V8 coverage info for ESM files? That way it may get away with not transforming the code. I assume the version of node that ships ESM would also have proper support for those APIs already.
c8 uses native V8 coverage. I just gave this a try with c8 node --experimental-modules ./bin.mjs, I did not get any coverage (tested with node 10.15.3 and 11.13.0).
In either case c8 is a different project from nyc. Native V8 coverage is very promising but IMO it's not ready to replace nyc.
Use cases 3, 11.
The text was updated successfully, but these errors were encountered: