forked from vinsonizer/f3-automation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
executable file
·50 lines (43 loc) · 1.13 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
43
44
45
46
47
48
49
50
var shell = require('gulp-shell');
var mocha = require('gulp-mocha');
var watch = require('gulp-watch');
var cover = require('gulp-coverage');
var jshint = require('gulp-jshint');
var gulp = require('gulp');
var srcRoot = './lib/';
var tstRoot = './test/';
gulp.task('lint', function() {
return gulp.src([
srcRoot + '*.js'
])
.pipe(jshint())
.pipe(jshint.reporter('jshint-stylish'));
//.pipe(jshint.reporter('fail')); //there is an issue with this reporter: skipping
});
gulp.task('test', function() {
return gulp.src(tstRoot + '*.js', {
read: false
})
.pipe(mocha());
});
gulp.task('coverage', function() {
return gulp.src(tstRoot + '*.js', {
read: false
})
.pipe(cover.instrument({
pattern: [srcRoot + '*.js'],
debugDirectory: 'debug'
}))
.pipe(mocha())
.pipe(cover.gather())
.pipe(cover.format())
.pipe(gulp.dest('reports'));
});
gulp.task('upload',
shell.task(['gapps upload'], {
cwd: '.'
}));
gulp.task('default', ['lint', 'test', 'upload']);
gulp.task('watch', function() {
gulp.watch([srcRoot + '*.js', tstRoot + '*.js'], ['lint', 'test']);
});