Skip to content

Instantly share code, notes, and snippets.

@dublx
Last active August 29, 2015 14:26
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
[nodejs:gulp] mocha watch
//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