danger-plugin-istanbul-coverage
danger-plugin-istanbul-coverage copied to clipboard
Wrong code coverage report message for with only files that have 0 coverage
issue is occurring when using the createdOrModifed config option
If the created or modified list contains only files with 0 code coverage then the wrong message appears
See examples below (2 PRS)
appears to be caused by percentage calculation logic in the combineItems function
is this intended? what is the reason for setting the percentage to 100 if second.covered + first.covered <= 0 ?
const combineItems = (first, second) => {
const percentage =
second.covered + first.covered > 0
? (100 * (first.covered + second.covered)) / (second.total + first.total)
: 100;
return {
total: first.total + second.total,
covered: first.covered + second.covered,
skipped: first.skipped + second.skipped,
pct: percentage,
};
};
I am experiencing the same issue which brought me here. Displaying 100% instead of 0% in this scenario is incorrect. Can this be corrected please?
@pc-mwong You created this issue over 2.5 years ago, but this issue still exists. Are you still managing with this issue being there? Or found a workaround, because constantly showing 0 for this scenario is misleading?