forked from freeCodeCamp/camper-gitter-bot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
38 lines (31 loc) · 827 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
38
const gulp = require('gulp');
const eslint = require('gulp-eslint');
const tape = require('gulp-tape');
const faucet = require('faucet');
const env = require('gulp-env');
require('dotenv').config({ path: 'dot.env' });
const scripts = ['config/*.js', 'data/rooms/*.js', 'data/*.js', 'lib/**/*.js',
'test/*.js', 'app.js', 'gulpfile.js'];
gulp.task('lint', () => {
return gulp.src(scripts)
.pipe(eslint())
.pipe(eslint.format());
});
gulp.task('test', ['set-env'], () => {
return gulp.src('test/*.spec.js')
.pipe(tape({
reporter: faucet()
}));
});
gulp.task('set-env', () => {
env({
vars: {
SERVER_ENV: 'test',
LOG_LEVEL: 0
}
});
});
gulp.task('watch', () => {
gulp.watch(scripts, ['lint', 'test']);
});
gulp.task('default', ['lint', 'test', 'watch']);