-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathGulpfile.js
More file actions
42 lines (36 loc) · 1002 Bytes
/
Gulpfile.js
File metadata and controls
42 lines (36 loc) · 1002 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
36
37
38
39
40
41
42
var gulp = require('gulp');
var jshint = require('gulp-jshint');
var nodemon = require('gulp-nodemon');
var mocha = require('gulp-mocha');
gulp.task('lint', function() {
return gulp.src(['./*.js',
'./routes/*.js',
'./public/**/*.js'
])
.pipe(jshint())
.pipe(jshint.reporter('default'));
});
gulp.task('mocha', function() {
return gulp.src('./test/**/*.js', {read: false})
.pipe(mocha())
.once('end', function () {
process.exit();
});
})
gulp.task('mocha-test', function() {
return gulp.src('./test/**/*.js', {read: false})
.pipe(mocha());
})
gulp.task('default', function() {
// place code for your default task here
});
gulp.task('serve', function() {
nodemon({ script: 'server.js', ext: 'html js' });
})
gulp.task('test', ['lint', 'mocha-test'], function () {
nodemon({ script: 'server.js', ext: 'html js', /*ignore: ['ignored.js']*/ })
.on('change', ['lint'])
.on('restart', function () {
console.log('restarted!')
})
})