-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
47 lines (36 loc) · 1.01 KB
/
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
'use strict';
var gulp = require('gulp');
var log = require('gulp-util').log;
var jshint = require('gulp-jshint');
var mocha = require('gulp-mocha');
var codeFiles = [
'server/**/*.js',
'!public/vendor/**/*.js',
'public/**/*.js',
'test/**/*.js'
];
var backendFiles = ['server/**/*.js'];
var testFiles = ['test/**/*.js'];
gulp.task('lint', function() {
log('Linting Files');
return gulp.src(codeFiles)
.pipe(jshint('.jshintrc'))
.pipe(jshint.reporter());
});
gulp.task('test_backend', function(){
log("Running tests");
return gulp.src(testFiles)
.pipe(mocha({reporter: 'spec'}));
});
gulp.task('watch', function() {
log('Watching Files');
gulp.watch(codeFiles, ['lint']);
gulp.watch(backendFiles, ['test_backend','lint']);
gulp.watch(testFiles, ['test_backend','lint']);
});
gulp.task('watch_backend', function() {
log('Watching Backends Files');
gulp.watch(backendFiles, ['test_backend']);
gulp.watch(testFiles, ['test_backend']);
});
gulp.task('default', ['lint', 'watch']);