-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgulpfile.js
More file actions
28 lines (23 loc) · 893 Bytes
/
gulpfile.js
File metadata and controls
28 lines (23 loc) · 893 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
'use strict';
const gulp = require('gulp');
const mocha = require('gulp-mocha');
const jshint = require('gulp-jshint');
const stylish = require('jshint-stylish');
const istanbul = require('gulp-istanbul');
const packageJSON = require('./package.json');
const { jshintConfig } = packageJSON;
gulp.task('lint', () => gulp.src(['./*.js', 'routes/**/*.js', 'test/**/*.js', 'src/**/*.js'])
.pipe(jshint(jshintConfig))
.pipe(jshint.reporter(stylish)));
gulp.task('unittest', () => gulp.src(['*.js', 'routes/**/*.js', 'src/**/*.js'])
.pipe(istanbul()) // Covering files
.pipe(istanbul.hookRequire()) // Force `require` to return covered files
.on('finish', () => {
gulp.src(['test/*.test.js'])
.pipe(mocha({ reporter: 'nyan' }))
.pipe(istanbul.writeReports());
}));
// @ts-ignore
gulp.task('test', ['unittest']);
// @ts-ignore
gulp.task('default', ['lint', 'test']);