-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGulpfile.js
50 lines (39 loc) · 1.02 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
var gulp = require('gulp'),
mocha = require('gulp-mocha'),
cover = require('gulp-coverage'),
$ = require('gulp-load-plugins')();
// RUN TESTS
gulp.task('test', function () {
gulp.src(['tests/**/*.js'], { read: false })
.pipe($.blanket({
instrument:['mime/mime.js'],
captureFile: 'coverage.html',
reporter: 'html-cov'
}));
});
gulp.task('testy', ['test', 'watch']);
gulp.task('test', function (cb) {
return gulp.src('tests/*.js', {read: false})
.pipe(mocha({reporter: 'nyan'}))
.pipe($.exit());
});
gulp.task('watch', function (cb) {
gulp.watch('tests/**/*.js', ['test']);
});
// NODEMON
gulp.task('default', function (cb) {
var called = false;
return $.nodemon({
script: 'server.js',
ext: 'js, jade, hbs, nj, styl, sass, less, css',
ignore: ['README.md', 'node_modules', '.DS_Store'],
'execMap': {
'js': 'iojs'
}
}).on('start', function () {
if (!called) {
called = true;
cb();
}
});
});