Skip to content
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

Wrong code coverage report message for with only files that have 0 coverage #58

Open
pc-mwong opened this issue Dec 14, 2020 · 3 comments

Comments

@pc-mwong
Copy link

pc-mwong commented Dec 14, 2020

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)

Screen Shot 2020-12-14 at 10 36 49 AM

Screen Shot 2020-12-14 at 10 47 12 AM

@pc-mwong
Copy link
Author

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,
  };
};

@singhrasster
Copy link

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?

@singhrasster
Copy link

@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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants