-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathgulpfile.js
More file actions
35 lines (29 loc) · 829 Bytes
/
gulpfile.js
File metadata and controls
35 lines (29 loc) · 829 Bytes
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
'use strict';
var gulp = require('gulp');
var karma = require('karma').server;
var jshint = require('gulp-jshint');
var stylish = require('jshint-stylish');
var clean = require('gulp-clean');
var mocha = require('gulp-mocha');
gulp.task('clean', function() {
gulp.src('results', {read: false})
.pipe(clean());
});
gulp.task('lint', function() {
gulp.src(['server/**/*.js'])
.pipe(jshint())
.pipe(jshint.reporter(stylish));
});
// Combined task test to test client then server (via callback)
gulp.task('test', function (cb) {
return gulp.src(['server/**/*.spec.js'], { read: false })
.pipe(mocha({
reporter: 'spec',
globals: {
}
}));
});
gulp.task('watch', function() {
gulp.watch(['server/**/*.js'], ['clean', 'lint', 'test']);
});
gulp.task('default', ['clean', 'lint', 'test']);