Enforce FE unit coverage with istanbul thresholds
Lets start enforcing minimum thresholds.
https://www.npmjs.com/package/karma-istanbul-threshold
We've discussed this plenty in the past and I may have opened this issue already, but lets decide on the optimum path.
I see 2 approaches here. 1 is very speedy and the other is much much much more useful.
-
Go with the flow (speedy, not that helpful, good start)
- Find out the minimum individual spec coverage (for each coverage type).
- Find out the minimum global spec coverage (for each coverage type).
- Enforce these minimums as the threshold.
- Increase
🤞 these threshold after a manual review each month.
-
Force the flow (needs research/code, very useful)
- Find/build script that will help istanbul distinguish between new files and old files.
- Use script to set a good 90% (or whatever we decide on) threshold for all new files.
- Use script to set thresholds for individual old files so that the coverage can never drop. (So now, if I add a line to some legacy code without a unit, I'm forced to write a partial unit to make sure my specific line (at least, because naturally the instrumentation causes increase coverage just for building and evaluating an empty spec)