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
Save dublx/8e89477bb3a91aa5bd5c to your computer and use it in GitHub Desktop.
[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