-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
40 lines (32 loc) · 914 Bytes
/
gulpfile.js
File metadata and controls
40 lines (32 loc) · 914 Bytes
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
var gulp = require('gulp');
var mocha = require('gulp-mocha');
var jshint = require('gulp-jshint');
var jscs = require('gulp-jscs');
var es = require('event-stream');
var paths = {
tests: ['test/test*.js'],
src: ['index.js', 'lib/**.js', 'bin/penelope'],
};
gulp.task('test', function() {
return gulp.src(paths.tests)
.pipe(mocha({reporter: 'spec'}))
.on('error', console.error);
});
gulp.task('jshint', function() {
var through = es.through();
return gulp.src(paths.src)
.pipe(jshint())
.pipe(jshint.reporter('default'));
});
gulp.task('jscs', function() {
return gulp.src(paths.src)
.pipe(jscs());
});
gulp.task('watch', function() {
gulp.src(paths.tests)
.pipe(mocha({reporter: 'spec'}))
.on('error', console.error);
gulp.watch(paths.tests, ['jscs', 'jshint', 'test']);
gulp.watch(paths.src, ['jscs', 'jshint', 'test']);
});
gulp.task('default', ['test']);