Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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}}));
});
.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);
.on('finish', function () {
gulp.src(['test/**/*.js'])
.pipe(mocha())
.pipe(istanbul.writeReports())
.pipe(istanbul.enforceThresholds({ thresholds: { global: 0 } }))
.pipe(envs.reset)
.on('end', cb);
});
});
.on('finish', function() {
gulp.src(['./test/*.js'])
.pipe(mocha({
reporter: 'spec'
}))
.pipe(istanbul.writeReports({
reporters: ['text', 'text-summary', 'html']
}))
.pipe(istanbul.enforceThresholds({
thresholds: {
global: 80
}
})).on('end', cb);
});
});
.on('finish', function () {
gulp.src(TEST_CASE_FILES)
.pipe(mocha({compilers: {js: babelRegister}}))
.pipe(istanbul.writeReports({
dir: BUILD_COVERAGE_REPORT_DIR
}))
.pipe(istanbul.enforceThresholds({
thresholds: {
global: 100
}
}))
.on('finish', done);
});
});