Closed
Description
- [ ] bug report -> please search issues before submitting
- [x ] feature request
Angular CLI 1.0.1 generates package.json that include an old version of the coverage plugin:
"karma-coverage-istanbul-reporter": "^0.2.0"
As a result, trying to set the thresholds for coverage doesn't work. Upgrade this dependency to
"karma-coverage-istanbul-reporter": "^1.2.0"
This will allow to make the tests with low coverage fail by adding thresholds to karma.conf.js, for example:
coverageIstanbulReporter: {
reports: ['html', 'lcovonly'],
fixWebpackSourcePaths: true,
thresholds: {
global: { // thresholds for all files
statements: 80,
lines: 80,
branches: 80,
functions: 80
},
each: { // thresholds per file
statements: 80,
lines: 80,
branches: 80,
functions: 80
}
}
}