Litee/jest-coverage-thresholds-bumper

Make it work with multiple thresholds

Opened this issue · 4 comments

 coverageThreshold: {
    global: {
      branches: 100,
      functions: 100,
      lines: 100,
      statements: 100,
    },
    './src/path1': {
      branches: 55,
      functions: 60,
      lines: 59,
      statements: 60,
    },
    './src/path2': {
      branches: 100,
      functions: 100,
      lines: 100,
      statements: 100,
    },
  },
Ignoring "lines" coverage threshold because new value 29.75 is less or equal to current value 100.
Ignoring "statements" coverage threshold because new value 30.2 is less or equal to current value 100.
Ignoring "branches" coverage threshold because new value 21.72 is less or equal to current value 100.
Ignoring "functions" coverage threshold because new value 21.53 is less or equal to current value 100.
Litee commented

That's a non-trivial one. It is easier to implement for JSON config format, but might be much harder for JS one. I cannot promise to implement it soon (not much free time), but will keep in my todo list.

c4ss commented

For JS/TS config files the library can manage a generated JSON file, which is required to be imported into the jest config for full functionality

This package is probably the best of the "jest bumpers" given how well it works with the various ways Jest can be configured and how simple it is to use. Not being able to handle multiple thresholds is a blocker unfortunately because the global values it calculates are incorrect in this case :(.

c4ss commented

Would be a lot simpler if istanbul supported more groups than "global". If it could be configured to report for jest projects as well as global that would massively reduce the logic required in this package