-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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 + ava gives 0 on all coverage lines #2417
Comments
I sometimes have trouble getting good reports out of
So… you're using ESM with Node.js 13? There's a good chance that (I'm closing this issue for housekeeping purposes, but let's keep the conversation going.) |
For some people nyc and esm works istanbuljs/nyc#905 |
Instead of using nyc, you can use https://github.com/bcoe/c8 which works with esm npm install --save c8 "scripts": {
"test": "ava",
"coverage": "c8 --reporter=html --reporter=text ava"
} |
This avoids the need for the generated CJS files and use of rollup in testing. Thanks to https://remysharp.com/2019/08/16/build-free-code-and-testing-es-module-imports and avajs/ava#2417 (comment) :-).
This avoids the need for the generated CJS files and use of rollup in testing. Thanks to https://remysharp.com/2019/08/16/build-free-code-and-testing-es-module-imports and avajs/ava#2417 (comment) :-).
I followed the steps from https://github.com/avajs/ava/blob/master/docs/recipes/code-coverage.md
My ava config from
package.json
isWhen I run the coverage script I get this:
I don't use babel, and imports are done with
import
notrequire
.I'm on the latest versions of node.js, ava, nyc
The text was updated successfully, but these errors were encountered: