forked from atticoos/gulp-ng-config
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
41 lines (35 loc) · 1.09 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
var gulp = require('gulp'),
mocha = require('gulp-mocha'),
jscs = require('gulp-jscs'),
jshint = require('gulp-jshint'),
stylish = require('jshint-stylish'),
istanbul = require('gulp-istanbul'),
coveralls = require('gulp-coveralls');
gulp.task('lint', function () {
return gulp.src(['gulp-ng-config.js', 'test/stream.js'])
.pipe(jshint('.jshintrc'))
.pipe(jshint.reporter('jshint-stylish'))
.pipe(jshint.reporter('fail'))
});
gulp.task('style', function () {
return gulp.src(['gulp-ng-config.js', 'test/stream.js'])
.pipe(jscs())
.pipe(jscs.reporter('console'))
.pipe(jscs.reporter('fail'));
});
gulp.task('pre-test', function () {
return gulp.src('gulp-ng-config.js')
.pipe(istanbul())
.pipe(istanbul.hookRequire());
});
gulp.task('unittest', ['pre-test'], function () {
return gulp.src('test/stream.js')
.pipe(mocha({reporter: 'spec'}))
.pipe(istanbul.writeReports());
});
gulp.task('coveralls', function () {
return gulp.src('coverage/lcov.info')
.pipe(coveralls());
});
gulp.task('test', ['lint', 'style', 'unittest']);
gulp.task('default', ['test']);