Last active
May 9, 2019 15:18
-
-
Save floatdrop/8246513 to your computer and use it in GitHub Desktop.
gulp.watch - run mocha tests on every file changed
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 i gulp gulp-watch gulp-mocha gulp-batch | |
var gulp = require('gulp'); | |
var mocha = require('gulp-mocha'); | |
var batch = require('gulp-batch'); | |
gulp.watch(['test/**', 'lib/**'], batch(function (events, cb) { | |
return gulp.src(['test/*.js']) | |
.pipe(mocha({ reporter: 'list' })) | |
.on('error', function (err) { | |
console.log(err.stack); | |
}); | |
})); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment