-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgulpfile.js
37 lines (31 loc) · 960 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
30
31
32
33
34
35
36
37
/**
* Created by vdimitrieski on 17.6.16..
*/
'use strict';
var gulp = require('gulp'),
mocha = require('gulp-mocha'),
nodemon = require('gulp-nodemon'),
eslint = require('gulp-eslint');
//run tests from the appropriate directories
gulp.task('test', function () {
return gulp.src(['./app/tests/**/*.js'])
.pipe(mocha()) //{reporter:'dot'}
.once('error', function (err) {
console.log(err.toString());
this.emit('end');
});
});
//test the quality of the code with ESLint
gulp.task('lint', function () {
return gulp.src(['**/*.js', '!node_modules/**', '!gulpfile.js'])
.pipe(eslint())
.pipe(eslint.formatEach())
.pipe(eslint.failAfterError());
});
gulp.task('watch', function () {
gulp.watch('./**/*.js', ['lint']);
});
gulp.task('develop', function () {
nodemon({script: './bin/www', ext: 'js', legacyWatch: true });
});
gulp.task('default', ['develop']);