-
Notifications
You must be signed in to change notification settings - Fork 35
/
gulpfile.js
52 lines (45 loc) · 1.12 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
47
48
49
50
51
52
process.env.NODE_ENV = 'test';
require('should');
var path = require('path');
var gulp = require('gulp');
var gutil = require('gulp-util');
var coffee = require('gulp-coffee');
var coffeelint = require('gulp-coffeelint');
var mocha = require('gulp-mocha');
// Files.
var src = 'src/**/*.coffee';
var tests = 'test/*.mocha.js';
// Coffee Lint
gulp.task('lint', function() {
gulp.src(src)
.pipe(coffeelint({
max_line_length: {
value: 100
},
indentation: {
value: 4
}
}))
.pipe(coffeelint.reporter());
});
// Compile coffee scripts.
gulp.task('coffee', ['lint'], function() {
return gulp.src(src)
.pipe(coffee({
bare: true
}).on('error', gutil.log))
.pipe(gulp.dest('lib'))
.on('error', gutil.log);
});
// Run tests.
gulp.task('mocha', ['coffee'], function() {
return gulp.src(tests)
.pipe(mocha({
timeout: 10000,
reporter: 'spec'
}));
});
gulp.task('watch', function() {
gulp.watch(src, ['coffee']);
});
gulp.task('default', ['coffee']);