Skip to content

Upgrade the version of karma-covrage-istanbul-reporter #6191

Closed
@yfain

Description

@yfain
- [ ] 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
        }
      }
    }

Metadata

Metadata

Assignees

Labels

P5The team acknowledges the request but does not plan to address it, it remains open for discussioneffort1: easy (hours)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions