Koleok / jest-coverage-ratchet

Uses jest coverage output to raise acceptable coverage threshold to current coverage
MIT License
41 stars 12 forks source link

Rounding coverage values down #9

Open Firellon opened 5 years ago

Firellon commented 5 years ago

How do you guys handle small (<1%) fluctuations of coverage values? I propose to enable an option to round the threshold values down in order to avoid errors thrown on minor test coverage decrements

utils.js

const takeMaxValues = R.reduce(
  (result, [key, val]) =>
    R.merge(result, { [key]: R.max(result[key] || 0, Math.floor(val)) }),
  {}
)
benadamstyles commented 4 years ago

I've patched my own local version of this package to include this functionality, I'd like to make a PR to upstream it into this package but I just want to be sure before I do that you will be up for merging it, @Koleok?

Koleok commented 4 years ago

@benadamstyles Sure thing 👍

etylsarin commented 1 year ago

Hi @Koleok as @benadamstyles hasn't done the PR, would you mind to incorporate the change @Firellon proposed?

Thank you!