This repository was archived by the owner on Sep 7, 2025. It is now read-only.
forked from deepal/node-dukpt
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
46 lines (40 loc) · 1.23 KB
/
gulpfile.js
File metadata and controls
46 lines (40 loc) · 1.23 KB
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
40
41
42
43
44
45
46
const gulp = require('gulp');
const eslint = require('gulp-eslint');
const mocha = require('gulp-mocha');
const istanbul = require('gulp-istanbul');
const coveralls = require('gulp-coveralls');
const path = require('path');
const fs = require('fs');
function lint() {
return gulp.src(['./src/**/*.js'])
.pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.failOnError());
}
function pretest() {
return gulp.src(['./src/**/*.js'])
.pipe(istanbul({ includeUntested: true }))
.pipe(istanbul.hookRequire());
}
function test() {
gulp.src(['./test/**/*.js'], { read: false })
.pipe(mocha())
.pipe(istanbul.writeReports({
dir: 'test-coverage/',
reportOpts: {
dir: 'test-coverage/'
},
reporters: ['lcov', 'text', 'text-summary', 'cobertura']
}))
.pipe(istanbul.enforceThresholds({ thresholds: { global: 1 } }));
return gulp.src('test-coverage/lcov.info')
.pipe(coveralls());
}
function watch() {
return gulp.watch(['./src/**/*.js'], 'test');
}
gulp.task('lint', lint);
gulp.task('pretest', pretest);
gulp.task('test', ['pretest'], test);
gulp.task('watch', watch);
gulp.task('default', ['test']);