forked from lesshint/lesshint
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
39 lines (31 loc) · 1007 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
39
var gulp = require('gulp');
var istanbul = require('gulp-istanbul');
gulp.task('lint', function () {
var eslint = require('gulp-eslint');
return gulp.src(['./lib/**/*.js', './test/**/*.js'])
.pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.failAfterError());
});
gulp.task('coverage', ['lint'], function () {
return gulp.src(['./lib/**/*.js'])
.pipe(istanbul())
.pipe(istanbul.hookRequire());
});
gulp.task('test', ['coverage'], function () {
var mocha = require('gulp-mocha');
return gulp.src(['./test/specs/**/*.js', '!./test/specs/util.js'])
.pipe(mocha())
.pipe(istanbul.writeReports())
.pipe(istanbul.enforceThresholds({
thresholds: {
global: 95
}
}));
});
gulp.task('coveralls', ['test'], function () {
var coveralls = require('gulp-coveralls');
return gulp.src('./coverage/lcov.info')
.pipe(coveralls());
});
gulp.task('default', ['test']);