-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathgulpfile.js
38 lines (34 loc) · 1002 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
require('babel-core/register');
const gulp = require('gulp');
const jscs = require('gulp-jscs');
const istanbul = require('gulp-istanbul');
const mocha = require('gulp-mocha');
const isparta = require('isparta');
const coveralls = require('gulp-coveralls');
gulp.task('lint', () => {
return gulp.src('src/**/*.js')
.pipe(jscs())
.pipe(jscs.reporter());
});
gulp.task('coveralls-coverage', function () {
return gulp.src(['src/**/*.js'])
.pipe(istanbul({
instrumenter: isparta.Instrumenter
}))
.pipe(istanbul.hookRequire());
});
gulp.task('coveralls-report', ['coveralls-coverage'], function () {
return gulp.src(['test/**/*.js'])
.pipe(mocha())
.pipe(istanbul.writeReports({
dir: './coverage',
reporters: [
'lcovonly'
],
reportOpts: { dir: './coverage' }
}));
});
gulp.task('coveralls', ['coveralls-report'], function () {
return gulp.src('./coverage/lcov.info')
.pipe(coveralls());
});