How to use the gulp-istanbul.hookRequire function in gulp-istanbul

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 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 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('pre-test', function () {
    return gulp.src('generators/**/*.js')
        .pipe(excludeGitignore())
        .pipe(istanbul({
            includeUntested: true
        }))
        .pipe(istanbul.hookRequire());
});
github howardabrams / node-mocks-http / gulpfile.js View on Github external
gulp.task('coverage', function (done) {
    gulp.src(files.src)
        .pipe(istanbul())
        .pipe(istanbul.hookRequire())
        .on('finish', function () {
            gulp.src(files.test)
                .pipe(mocha({reporter: 'dot'}))
                .pipe(istanbul.writeReports({
                    dir: './coverage',
                    reporters: ['lcov', 'json', 'html'],
                    reportOpts: { dir: './coverage' }
                }))
                .on('end', done);
        });
});
github typestack / class-validator / gulpfile.ts View on Github external
coveragePre() {
        return gulp.src(["./build/compiled/src/**/*.js"])
            .pipe(istanbul())
            .pipe(istanbul.hookRequire());
    }
github typestack / routing-controllers / gulpfile.ts View on Github external
coveragePre() {
        return gulp.src(["./build/compiled/src/**/*.js"])
            .pipe(istanbul())
            .pipe(istanbul.hookRequire());
    }
github typestack / class-transformer / gulpfile.ts View on Github external
coveragePre() {
        return gulp.src(["./build/es5/src/**/*.js"])
            .pipe(istanbul())
            .pipe(istanbul.hookRequire());
    }
github analog-nico / two-buckets-memcache / gulpfile.js View on Github external
function instrument() {
    return gulp.src(paths.libJsFiles)
        .pipe(istanbul())
        .pipe(istanbul.hookRequire());
}
github analog-nico / stealthy-require / gulpfile.js View on Github external
function instrument() {
    return gulp.src(paths.libJsFiles)
        .pipe(istanbul())
        .pipe(istanbul.hookRequire());
}
github reducejs / gulp.spritesmith-multi / gulpfile.js View on Github external
function instrument() {
  var istanbul = require('gulp-istanbul')
  return gulp.src(['lib/*.js', 'index.js'])
    .pipe(istanbul({ includeUntested: true }))
    .pipe(istanbul.hookRequire())
}

gulp-istanbul

Istanbul unit test coverage plugin for gulp.

MIT
Latest version published 6 years ago

Package Health Score

47 / 100
Full package analysis