No Code Coverage Results with Mocha, NYC, ESM

I'm having difficulty getting code coverage to show up in my project.  I'm using WS 2022.2.  My project is using mocha and NYC.  The tests are running just fine.  All my test files are in  /tests directory.  When I try to run with coverage, the tests also run fine, but there are no results.  The raw file that NYC outputs is empty, and I get no highlighting.  My setup is pointing correctly to my mocha directory in node_modules.  Not sure what the issue is.  Not seeing any error message that would lead me deeper.  I'm on a Windows 11 machine if that makes a difference.  Node 16.

3 comments
Comment actions Permalink

And maybe if it helps, I'm using ES6 not CJS.  

0
Comment actions Permalink

I guess for anyone else reading, NYC still does not support ESM natively.  There's some experimental hooks that I couldn't get working.  C8 does support ESM, but Web Storm does not yet support it.  Would be nice if the Web Storm docs said they don't support ESM code coverage.

0

Please sign in to leave a comment.