-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
29 lines (25 loc) · 843 Bytes
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
var gulp = require('gulp');
var gutil = require('gulp-util');
var mocha = require('gulp-mocha');
var watch = require('gulp-watch');
var eslint = require('gulp-eslint');
// var notify = require('gulp-notify');
// error handler
function handleErr(err) {
if (err && /test?s failed/.test(err.message))
gutil.log(err.message);
}
gulp.task('watch', function() {
return gulp.src(['!tests/scripts/**/*', 'tests/**/*.js', 'hello-backbone/**/*.js'])
.pipe(watch({ emit: 'all', name: 'hello-backbone' }, function(files) {
files
.pipe(eslint())
.pipe(eslint.format('stylish'))
.pipe(mocha({ reporter: 'spec' }))
// .pipe(notify('files linted and tested :)'))
.on('error', handleErr);
}));
});
gulp.task('default', ['watch']);
// gutil.log => [gulp] message...
// console.log => message...