-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathgulpfile.js
More file actions
32 lines (28 loc) · 715 Bytes
/
gulpfile.js
File metadata and controls
32 lines (28 loc) · 715 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
'use strict';
var gulp = require('gulp'),
jshint = require('gulp-jshint'),
mocha = require('gulp-mocha'),
stylish = require('jshint-stylish');
gulp.task('lint', function () {
return gulp.src([
'./*.js',
'./src/**/*.js',
'./test/**/*.js'
])
.pipe(jshint())
.pipe(jshint.reporter(stylish))
.pipe(jshint.reporter('fail'));
});
gulp.task('test', function () {
process.env.NODE_ENV = true;
return gulp.src('./src/**/*.js')
.on('finish', function () {
return gulp.src('./test/**/*.js', {
read: false
})
.pipe(mocha({
reporter: 'spec'
}));
});
});
gulp.task('default', ['lint', 'test']);