forked from xeodou/gulp-atom
-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathgulpfile.js
48 lines (40 loc) · 1 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
'use strict';
/* jshint node:true */
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 = '*.coffee';
var tests = 'test/*.mocha.js';
// Coffee Lint
gulp.task('lint', function() {
gulp.src(src)
.pipe(coffeelint())
.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('.'))
.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']);