-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgulpfile.js
44 lines (31 loc) · 1.01 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
'use strict';
var gulp = require('gulp');
var coveralls = require('gulp-coveralls');
var jshint = require('gulp-jshint');
var mocha = require('gulp-mocha');
var shell = require('gulp-shell');
var files = ['lib/**/*.js'];
var unitTests = ['test/**/*.js'];
var alljs = files.concat(unitTests);
var buildBinPath = './node_modules/.bin/';
/**
* testing
*/
gulp.task('test:node', function() {
return gulp.src(unitTests).pipe(new mocha({ reporter: 'spec' }));
});
gulp.task('test', ['test:node']);
/**
* code quality and documentation
*/
gulp.task('lint', function() {
return gulp.src(alljs)
.pipe(jshint())
.pipe(jshint.reporter('default'));
});
gulp.task('plato', shell.task([buildBinPath + 'plato --dir report --recurse --jshint .jshintrc lib']));
gulp.task('coverage', shell.task([buildBinPath + './istanbul cover ' + buildBinPath + '_mocha -- --recursive']));
gulp.task('coveralls', ['coverage'], function() {
gulp.src('coverage/lcov.info').pipe(coveralls());
});
gulp.task('default', ['lint', 'coverage']);