Coverage report fails when there are 0 resources
raemer opened this issue · 0 comments
raemer commented
Hi,
while writing tests for a provider with coverage reports on, I noticed this behavior:
If there are no resources, this is detected correctly as "Total resources: 0, Touched resources: 0", but the resources coverage is NaN%. The code coverage check then fails:
expected: >= 100.0
got: 0.0
As the test doesn't really have a meaning if there are no resources, I implemented a check if the total is zero, setting the coverage to 100% if so and opened pull request #802 .
Though 100% is as wrong as 0%, it seems to be more useful as it does not generate meaningless failed tests.
Best regards,
Jan-Martin