forked from fitnessforlife/mfp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
48 lines (42 loc) · 1.07 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
'use strict';
var gulp = require('gulp');
var jshint = require( 'gulp-jshint' );
var stylish = require( 'jshint-stylish' );
var mocha = require('gulp-mocha');
var istanbul = require('gulp-istanbul');
//var coveralls = require('gulp-coveralls');
gulp.task('lint', function ( cb ) {
gulp.src([
'./!(coverage|node_modules)/**/*.js'
])
.pipe( jshint() )
.pipe( jshint.reporter( stylish ) );
});
gulp.task('test', function(cb){
gulp.src([
'./mfp_functions/**/*.js',
'./index.js'
])
.pipe( istanbul() )
.pipe(istanbul.hookRequire()) // Force `require` to return covered files
.on( 'finish', function(){
gulp.src([
'./test/**/*.js'
])
.pipe( mocha({ reporter: 'spec' }) )
.pipe( istanbul.writeReports() )
.on( 'end', cb);
});
});
// appears misconfigured, removed
/*
gulp.task('coveralls', function(cb){
return gulp.src('./coverage/lcov.info')
.pipe(coveralls());
});
*/
gulp.task('watch', function(){
gulp.watch('./mfp_functions/**', ['lint', 'test']);
gulp.watch('./test/**', ['lint', 'test']);
});
gulp.task('default', ['watch']);