Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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));
}
}
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);
});
});
gulp.task('pre-test', function () {
return gulp.src('generators/**/*.js')
.pipe(excludeGitignore())
.pipe(istanbul({
includeUntested: true
}))
.pipe(istanbul.hookRequire());
});
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);
});
});
coveragePre() {
return gulp.src(["./build/compiled/src/**/*.js"])
.pipe(istanbul())
.pipe(istanbul.hookRequire());
}
coveragePre() {
return gulp.src(["./build/compiled/src/**/*.js"])
.pipe(istanbul())
.pipe(istanbul.hookRequire());
}
coveragePre() {
return gulp.src(["./build/es5/src/**/*.js"])
.pipe(istanbul())
.pipe(istanbul.hookRequire());
}
function instrument() {
return gulp.src(paths.libJsFiles)
.pipe(istanbul())
.pipe(istanbul.hookRequire());
}
function instrument() {
return gulp.src(paths.libJsFiles)
.pipe(istanbul())
.pipe(istanbul.hookRequire());
}
function instrument() {
var istanbul = require('gulp-istanbul')
return gulp.src(['lib/*.js', 'index.js'])
.pipe(istanbul({ includeUntested: true }))
.pipe(istanbul.hookRequire())
}