Created
January 4, 2016 20:48
-
-
Save oeeckhoutte/5d93e272008e32db0798 to your computer and use it in GitHub Desktop.
Gulp tests
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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