karma-threshold-reporter

A Karma plugin. Fail tests if the coverage falls below the given threshold.

MIT 8 个版本
安装
npm install karma-threshold-reporter
yarn add karma-threshold-reporter
pnpm add karma-threshold-reporter
bun add karma-threshold-reporter
README

karma-threshold-reporter

Fail the build if the coverage falls below a pre configured value

Installation

The easiest way is to keep karma-threshold-reporter as a devDependency in your package.json.

{
  "devDependencies": {
    "karma": "~0.10",
    "karma-threshold-reporter": "~0.1.7"
  }
}

You can simple do it by:

npm install karma-threshold-reporter --save-dev

NPM Stats

Configuration

// karma.conf.js or karma-e2e.conf.js
module.exports = function(config) {
  config.set({
  
    plugins: ['karma-threshold-reporter'],
  
    reporters: ['progress', 'coverage','threshold'],

    // the configure thresholds
    thresholdReporter: {
      statements: 90,
      branches: 60,
      functions: 85,
      lines: 90
    }
  });
};

You can pass list of reporters as a CLI argument too:

karma start --reporters coverage,threshold

For more information on Karma see the homepage.

版本列表
0.1.15 2015-02-05
0.1.12 2014-11-17
0.1.11 2014-11-17
0.1.9 2014-07-02
0.1.7 2013-12-27
0.1.6 2013-12-27
0.1.5 2013-12-27
0.1.3 2013-12-26