Closed sergiitk closed 5 years ago
Hi @sergiitk!
From the https://github.com/standard-things/esm/compare/3.2.9...3.2.10 range I see https://github.com/standard-things/esm/commit/e5a3dcdd11e7460afeaa297283b0d72fe02f20b6. I noticed the files you're wanting code-coverage for are .mjs
. Under the esm
rules:
:lock:
.mjs
files are limited to basic functionality without support foresm
options.
This is because in the current and next experimental phase of modules in Node the .mjs
module will not support features like nyc
. The easy way around this is to simply use .js
for ESM code.
Thank you for the explanation @jdalton. And my apologies for the invalid report.
@sergiitk No worries! Thank you for reporting the issue (don't worry about the issue designation).
@jdalton FYI I replaced --experimental-modules
with -r esm
, renamed .mjs -> .js
.
Latest esm
3.2.14
works perfect with nyc
+ ava
! Thanks a lot!
Ref sergiitk/pagerbeauty#96. Also for those who interested, this is good reads confirming what @jdalton said: http://2ality.com/2018/12/nodejs-esm-phases.html https://github.com/nodejs/modules/blob/master/doc/plan-for-new-modules-implementation.md
After updating
esm
from3.2.0
to3.2.14
in my project (sergiitk/pagerbeauty#94)nyc
stopped reporting code coverage. I run my tests with nyc + ava; ava requiresesm
. Here's my setup:Test command:
nyc config:
Ava config:
I was able to pinpoint excatly what release introduced the regression: it's
3.2.10
. The changelog for this release looks unrelated. I used yarn resolution to dowgrade to3.2.9
andnyc
works as expected.Here's how
nyc
report withesm
>3.2.10
looks like:Here's the same code with
esm
pinned to3.2.9
works as expected: