Created
September 24, 2014 10:49
-
-
Save medatech/76c6017cf55630b2db08 to your computer and use it in GitHub Desktop.
An example of code coverage with Gulp
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 istanbul = require('gulp-istanbul'); | |
var mocha = require('gulp-mocha'); | |
gulp.task('test', function (cb) { | |
gulp.src(['lib/**/*.js', 'web.js', 'api.js']) | |
.pipe(istanbul()) // Covering files | |
.on('finish', function () { | |
gulp.src(['test/**/*.js']) | |
.pipe(mocha()) | |
.pipe(istanbul.writeReports({ | |
dir: './coverage', | |
reporters: [ 'lcov', 'json', 'text', 'text-summary' ], | |
reportOpts: { dir: './coverage' } | |
})) // Creating the reports after tests runned | |
.on('end', cb); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment