How to use gulp-istanbul - 10 common examples

To help you get started, we’ve selected a few gulp-istanbul examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github typestack / routing-controllers / gulpfile.ts View on Github external
coveragePost() {
        chai.should();
        // chai.use(require("sinon-chai"));
        // chai.use(require("chai-as-promised"));

        return gulp.src([
            "./build/compiled/test/functional/**/*.js",
            "./build/compiled/test/issues/**/*.js",
        ])
            .pipe(mocha())
            .pipe(istanbul.writeReports());
    }
github the-simian / slush-phaser-webpack / gulpfile.js View on Github external
function runner() {
    return gulp
      .src(testGlob)
      .pipe(mocha(mochaOpts))
      //      .on('error', function (err) {
      //        gutil.log(err);
      //        this.emit('end');
      //      })
      .pipe(istanbul.writeReports())
      .on('end', cb);
  }
github mlucool / gulp-jsdoc3 / gulpfile.js View on Github external
gulp.task('test', ['pre-test'], function () {
    // Everything file loaded from here uses babel with .babelrc
    require('babel-core/register'); // https://babeljs.io/docs/usage/require/

    return gulp.src(specs, {read: false})
        .pipe(mocha())
        .pipe(istanbul.writeReports())
        // Enforce a coverage of at least 90%
        .pipe(istanbul.enforceThresholds({thresholds: {global: 75}}));
});
github ukayani / restify-router / gulpfile.js View on Github external
.on('finish', function () {
      return gulp.src(testSourceFiles)
        .pipe(mocha())
        .on('error', gutil.log)
        .pipe(istanbul.writeReports()) // Creating the reports after tests ran
        .pipe(istanbul.enforceThresholds({thresholds: {global: 95}})) // Enforce a coverage of at least 100%
        .on('end', done);

    })
    .on('error', gutil.log);
github microsoft / rushstack / core-build / gulp-core-build-mocha / src / InstrumentTask.ts View on Github external
public executeTask(gulp: typeof Gulp, completeCallback?: (error?: string) => void): NodeJS.ReadWriteStream {
    // eslint-disable-next-line @typescript-eslint/no-var-requires
    const istanbul: typeof gulpIstanbul = require('gulp-istanbul');

    return gulp.src(this.taskConfig.coverageMatch)
      // Covering files
      .pipe(istanbul())
      // Force `require` to return covered files
      .pipe(istanbul.hookRequire())
      // Write the covered files to a temporary directory
      .pipe(gulp.dest(this.buildConfig.tempFolder));
  }
}
github typestack / class-validator / gulpfile.ts View on Github external
coveragePost() {
        chai.should();
        chai.use(require("sinon-chai"));
        chai.use(require("chai-as-promised"));

        return gulp.src(["./build/compiled/test/**/*.js"])
            .pipe(mocha())
            .pipe(istanbul.writeReports());
    }
github deepal / node-dukpt / gulpfile.js View on Github external
function test() {
    gulp.src(['./test/**/*.js'], { read: false })
        .pipe(mocha())
        .pipe(istanbul.writeReports({
            dir: 'test-coverage/',
            reportOpts: {
                dir: 'test-coverage/'
            },
            reporters: ['lcov', 'text', 'text-summary', 'cobertura']
        }))
        .pipe(istanbul.enforceThresholds({ thresholds: { global: 1 } }));
    return gulp.src('test-coverage/lcov.info')
        .pipe(coveralls());
}
github deepal / node-dukpt / dist / gulpfile.js View on Github external
function test() {
    gulp.src(['./test/**/*.js'], { read: false }).pipe(mocha()).pipe(istanbul.writeReports({
        dir: 'test-coverage/',
        reportOpts: {
            dir: 'test-coverage/'
        },
        reporters: ['lcov', 'text', 'text-summary', 'cobertura']
    })).pipe(istanbul.enforceThresholds({ thresholds: { global: 1 } }));
    return gulp.src('test-coverage/lcov.info').pipe(coveralls());
}
github sap9433 / yoSapy / gulpfile.js View on Github external
gulp.task('test', function test(coverage) {
    gulp.src('app/*.js')
        .pipe(istanbul({
        	includeUntested: true
        }))
        .pipe(istanbul.hookRequire())
        .on('finish', function() {
            gulp.src(['test/*.js'])
                .pipe(jasmine())
                .pipe(istanbul.writeReports())
                .on('end', coverage);
        });
});
github QMUI / generator-qmui / gulpfile.js View on Github external
gulp.task('test', ['pre-test'], function (cb) {
    var mochaErr;

    gulp.src('test/**/*.js')
        .pipe(plumber())
        .pipe(mocha({reporter: 'spec'}))
        .on('error', function (err) {
            mochaErr = err;
        })
        .pipe(istanbul.writeReports())
        .on('end', function () {
            cb(mochaErr);
        });
});

gulp-istanbul

Istanbul unit test coverage plugin for gulp.

MIT
Latest version published 7 years ago

Package Health Score

47 / 100
Full package analysis