Autotest using tape and faucet with gulp
I was looking for a way to run my tests written for tape continuously with gulp and came up with this. Obviously you need to have installed tape and faucet with -g but you'll probably do that anyway. If there's a better way, throw in a comment.
var shell = require('gulp-shell')
gulp.task('exec-tests', shell.task([
'tape test/* | faucet',
]));
gulp.task('autotest', ['exec-tests'], function() {
gulp.watch(['app/**/*.js', 'test/**/*.js'], ['exec-tests']);
});
Example:
git:master ❯❯❯ gulp autotest
[gulp] Starting 'exec-tests'...
✓ square2rect
✓ pointInsideRect
✓ doRectsOverlap
# tests 7
# pass 7
✓ ok
[gulp] Finished 'exec-tests' after 138 ms
[gulp] Starting 'autotest'...
[gulp] Finished 'autotest' after 32 ms
Written by Raine Virta
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#