Plugin for gulp that enforces coverage thresholds from Istanbul.
Based on grunt-istanbul-coverage, which enforces istanbul coverage in grunt.
npm install --save-dev gulp-istanbul-enforcerThen, 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));
});###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.
