Skip to content

Instantly share code, notes, and snippets.

@oeeckhoutte
Created January 4, 2016 20:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oeeckhoutte/5d93e272008e32db0798 to your computer and use it in GitHub Desktop.
Save oeeckhoutte/5d93e272008e32db0798 to your computer and use it in GitHub Desktop.
Gulp tests
var gulp = require('gulp');
var fs = require('fs');
var istanbul = require('gulp-istanbul');
var jasmine = require('gulp-jasmine');
var clean = require('gulp-clean');
cover = require('gulp-coverage');
var $ = require('gulp-load-plugins')({
scope: ['dependencies']
});
gulp.task('clean-reports', function () {
return gulp.src('coverage', {read: false})
.pipe(clean());
});
gulp.task('spec', ['clean-reports'], function () {
return gulp.src([
'app/**/*.js',
'!app/**/*spec.js'
])
.pipe(istanbul({includeUntested: true}))
.on('finish', function() {
gulp.src('app/**/*spec.js')
.pipe(jasmine({
verbose: true,
color: true
}))
.pipe(istanbul.writeReports({
dir: './coverage',
reporters: [ 'lcov' ],
reportOpts: { dir: './coverage' }
}));
});
});
gulp.task('spec_no_cc', function () {
return gulp.src('app/**/*spec.js')
.pipe(jasmine({
verbose: true,
color: true
}));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment