Empty files in code coverage should fail since it doesn't reach the test requirement.
Since this isn't considered a bug, could it be a feature with an added flag/configuration that a user can add that way it will force users to create tests?
Observed Behavior
The code coverage result below is a success, but the file fakebox.tsx is empty so it shows 0. Since box.tsx was a success, it will pass the test anyway despite the problem with fakebox.tsx
Could we get a new flag/config that fails the test if there are empty files that output 0?
for ex: failOnEmpty = true (default false) or similar, please 🙏🏼 ?
Thank you in advance!
Link to bug demonstration repository
At first I thought it was a bug which is why I created a stackoverflow question: https://stackoverflow.com/questions/73115602/cypress-code-coverage-one-file-with-0-should-fail-test until I found an existing github issue: https://github.com/istanbuljs/nyc/issues/1166 that was ignored and closed which was exactly what we need. I was hoping to revive this topic and hopefully have it as a feature.
Expected Behavior
Empty files in code coverage should fail since it doesn't reach the test requirement. Since this isn't considered a bug, could it be a feature with an added flag/configuration that a user can add that way it will force users to create tests?
Observed Behavior
The code coverage result below is a success, but the file
fakebox.tsx
is empty so it shows 0. Sincebox.tsx
was a success, it will pass the test anyway despite the problem withfakebox.tsx
Troubleshooting steps
cache: false
in my nyc configperFile
andall
to trueEnvironment Information
in short:
Could we get a new flag/config that fails the test if there are empty files that output 0? for ex:
failOnEmpty = true (default false)
or similar, please 🙏🏼 ? Thank you in advance!