Last active
August 29, 2015 14:26
-
-
Save dublx/8e89477bb3a91aa5bd5c to your computer and use it in GitHub Desktop.
[nodejs:gulp] mocha watch
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
//npm install --save-dev gulp gulp-mocha gulp-util | |
var gulp = require('gulp'); | |
var mocha = require('gulp-mocha'); | |
var gutil = require('gulp-util'); | |
gulp.task('mocha', function() { | |
return gulp.src(['test/**/*.js'], { read: false }) | |
.pipe(mocha({ reporter: 'spec' })) | |
.on('error', gutil.log); | |
}); | |
gulp.task('watch-mocha', function() { | |
gulp.run('mocha'); | |
gulp.watch(['lib/**', 'test/**'], ['mocha']); | |
}); | |
gulp.task('default',['watch-mocha']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment