Instantly share code, notes, and snippets.

@dublx /gulpfile.js
Last active Aug 29, 2015

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