gulp-istanbul-enforcer

2019-01-12 admin

gulp-istanbul-enforcer是什么

什么是gulp-istanbul-enforcer,Plugin for gulp that enforces coverage thresholds from Istanbul

gulp-istanbul-enforcer使用教程帮助文档

gulp-istanbul-enforcer

Build Status

Plugin for gulp that enforces coverage thresholds from Istanbul.

Based on grunt-istanbul-coverage, which enforces istanbul coverage in grunt.

Installation

npm install --save-dev gulp-istanbul-enforcer

Example

Then, add it to your gulpfile.js:

var coverageEnforcer = require("gulp-istanbul-enforcer");

gulp.task('enforce-coverage', function () {
  var options = {
        thresholds : {
          statements : 100,
          branches : 100,
          lines : 100,
          functions : 100
        },
        coverageDirectory : 'coverage',
        rootDirectory : ''
      };
  return gulp
    .src('.')
    .pipe(coverageEnforcer(options));
});

Options

###thresholds Set the required percentage levels for each of the coverage measurements (statements, branches, lines, functions).

###coverageDirectory The directory that istanbul has outputted the coverage results to.

###rootDirectory The root directory of the project, in most cases this can be set to blank.

本站文章除注明转载外,均为本站原创或编译。欢迎任何形式的转载,但请务必注明出处。

转载请注明:文章转载自 JavaScript中文网 [https://www.javascriptcn.com]

本文地址:https://www.javascriptcn.com/read-50816.html

文章标题:gulp-istanbul-enforcer

回到顶部