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
Is this expected behavior? Does the very act of importing file cause the entire file to be considered covered, unless proven otherwise? My apologies if I missed an existing image, or docs regarding this.
Please let me know if I can provide any further help.
The text was updated successfully, but these errors were encountered:
@drazisil I believe that this is expected behavior. V8 sees the classes themselves as having been covered, but as you do not call the constructor for either class, they will both not have been called.
Importing a file causes it to be executed (this is actually similar behavior to nyc, it's how you'd collect coverage for a script). The major reason for the discrepancy between c8/nyc, is that nyc doesn't properly parse ESM.
Linux banana 5.15.25-1-MANJARO #1 SMP PREEMPT Wed Feb 23 14:44:03 UTC 2022 x86_64 GNU/Linux
When running
c8 mocha
in a repository, c8 is reporting coverage on all lines that are not code.Example repo: https://github.com/drazisil/c8-test
Coverage with c8: (
npm run
)Expected coverage with nyc: (
npx nyc --all mocha
)Is this expected behavior? Does the very act of importing file cause the entire file to be considered covered, unless proven otherwise? My apologies if I missed an existing image, or docs regarding this.
Please let me know if I can provide any further help.
The text was updated successfully, but these errors were encountered: