forked from mlison/protractor-jasmine2-screenshot-reporter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
42 lines (36 loc) · 1.04 KB
/
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
40
41
42
'use strict';
var gulp = require('gulp'),
jshint = require('gulp-jshint'),
mocha = require('gulp-mocha'),
istanbul = require('gulp-istanbul');
gulp.task('lint', function () {
return gulp.src(['**/*.js','!node_modules/**','!coverage/**'])
.pipe(jshint())
.pipe(jshint.reporter('default'));
});
gulp.task('pre-test', function () {
return gulp.src(['**/*.js','!node_modules/**','!coverage/**','!test/**'])
// Covering files
.pipe(istanbul())
// Force `require` to return covered files
.pipe(istanbul.hookRequire());
});
gulp.task('test', ['pre-test'], function () {
return gulp.src('test/*.js')
.pipe(mocha())
.pipe(istanbul.writeReports())
.pipe(istanbul.enforceThresholds({
thresholds: {
global: {
statements: 50,
branches: 50,
lines: 50,
functions: 50
}
}
}));
});
gulp.task('pre-commit', ['lint', 'test']); //test before pre commit
gulp.task('default', ['lint', 'test'], function () {
console.info('All packed up and ready to go!');
});