Skip to content

Instantly share code, notes, and snippets.

@edwinestrada
Created December 18, 2015 19:09
Show Gist options
  • Save edwinestrada/6177f48f16efdb4d6b50 to your computer and use it in GitHub Desktop.
Save edwinestrada/6177f48f16efdb4d6b50 to your computer and use it in GitHub Desktop.
WIP gulp file for snapsnip api
var gulp = require('gulp');
var mocha = require('gulp-mocha');
var shell = require('gulp-shell');
var coffee = require('gulp-coffee');
var runSequence = require('run-sequence');
gulp.task('monitor-coffee-files', function() {
return gulp.watch(['lib/api/**/*.coffee'], ['clear-terminal', 'run-tests']);
});
gulp.task('clear-terminal', shell.task([
'clear'
]));
gulp.task('run-tests', function() {
return gulp
.src(['**/*.spec.coffee'])
.pipe(coffee())
// .pipe(coffee({bare: true})
.pipe(gulp.dest('.'))
.pipe(mocha({reporter: 'spec'}));
});
gulp.task('monitor-js-files', function() {
return gulp.watch(['lib/api/v1/**/*.js'], ['jsdoc', 'run-tests']);
});
gulp.task('jsdoc', shell.task([
'jsdoc lib/api/v1/users/users.js'
]));
gulp.task('default', function(done) {
runSequence(
[
'monitor-coffee-files',
'monitor-js-files'
],
done
);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment