Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nyc not working with project type module (esm) #1544

Open
manuelbarzi opened this issue Jan 17, 2024 · 3 comments
Open

nyc not working with project type module (esm) #1544

manuelbarzi opened this issue Jan 17, 2024 · 3 comments

Comments

@manuelbarzi
Copy link

Expected Behavior

to extract a code coverage report in text and html format for my node project working as a module (with esm)

Observed Behavior

NOT WORKING!

=============================== Coverage summary ===============================
Statements   : Unknown% ( 0/0 )
Branches     : Unknown% ( 0/0 )
Functions    : Unknown% ( 0/0 )
Lines        : Unknown% ( 0/0 )
================================================================================

Troubleshooting steps

  • [ YES] still occurring when I put cache: false in my nyc config

Environment Information

  System:
    OS: macOS 14.1.1
    CPU: (8) arm64 Apple M2
    Memory: 40.91 MB / 16.00 GB
  Binaries:
    Node: 21.6.0 - /usr/local/bin/node
    npm: 10.2.4 - /usr/local/bin/npm
    pnpm: 8.10.5 - /usr/local/bin/pnpm
  npmPackages:
    nyc: ^15.1.0 => 15.1.0 
@nuxy
Copy link

nuxy commented Mar 3, 2024

Experiencing the same issue in Node: v20.11.0 when running ESM code.

Tested with, or without --require esm

@adamreisnz
Copy link

Duplicate of #1530 I think

@manuelbarzi
Copy link
Author

manuelbarzi commented Aug 9, 2024

finally c8 worked for me, instead of nyc (which is still failing):

c8 --experimental-monocart --reporter=html --reporter=text mocha logic/*.spec.js

(monocart-coverage-reports dependency must be installed)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants