-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
34 lines (28 loc) · 892 Bytes
/
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
var gulp = require('gulp');
var mocha = require('gulp-mocha');
var gutil = require('gulp-util');
var jshint = require('gulp-jshint');
var jscs = require('gulp-jscs');
var TEST_SRC_FILES = 'test/**/*.js';
var LIB_SRC_FILES = 'lib/**/*.js';
gulp.task('default', ['lint', 'jscs', 'mocha']);
gulp.task('mocha', function() {
return gulp.src(TEST_SRC_FILES, { read: false })
.pipe(mocha({ reporter: 'spec' }))
.on('error', gutil.log);
});
gulp.task('watch', function() {
gulp.watch([TEST_SRC_FILES, LIB_SRC_FILES], ['lint', 'jscs', 'mocha']);
});
gulp.task('lint', function() {
gulp.src(LIB_SRC_FILES)
.pipe(jshint())
.pipe(jshint.reporter('cool-reporter'))
.pipe(jshint.reporter('fail'))
.on('error', gutil.log);
});
gulp.task('jscs', function() {
gulp.src(LIB_SRC_FILES)
.pipe(jscs())
.on('error', function(error) { gutil.log(error.message); });
});