-
Notifications
You must be signed in to change notification settings - Fork 41
/
Copy pathgulpfile.js
46 lines (38 loc) · 1.1 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
/**
* @description - gulp build file
*
* @copyright Ian Kelly 2015
*/
'use strict';
var gulp = require('gulp');
var jshint = require('gulp-jshint');
var mocha = require('gulp-mocha');
var shell = require('gulp-shell');
// set coveralls environmental variable
process.env['COVERALLS_REPO_TOKEN'] = 'rCIR66aQA8jUA7Berlh1PHd917mjMt4hU';
/**
* Linting task
*/
gulp.task('lint', function() {
return gulp.src(['lib/**/*.js', 'test/unit/**/*.js', 'gulpfile.js'])
.pipe(jshint())
.pipe(jshint.reporter('default'))
.pipe(jshint.reporter('fail'));
});
/**
* Task for developer test and coverage report
*/
gulp.task('test', function () {
return gulp.src(['lib/**/*.js', 'test/unit/**/*.js'], { read: false })
.pipe(mocha());
});
gulp.task('coverage', shell.task([
'./node_modules/.bin/nyc gulp test',
'./node_modules/.bin/nyc report --reporter=html',
]));
gulp.task('coveralls', shell.task([
'./node_modules/.bin/nyc gulp test',
'./node_modules/.bin/nyc report --reporter=text-lcov | coveralls'
]));
gulp.task('default', gulp.series(['lint', 'test']));
gulp.task('travis', gulp.series(['lint', 'test']));