forked from hexojs/hexo-renderer-markdown-it
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
36 lines (30 loc) · 852 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
35
36
var gulp = require('gulp');
var $ = require('gulp-load-plugins')();
var del = require('del');
gulp.task('coverage', function(){
return gulp.src('lib/*.js')
.pipe($.istanbul())
.pipe($.istanbul.hookRequire());
});
gulp.task('coverage:clean', function(callback){
del(['coverage', 'string'], callback);
});
gulp.task('mocha', ['coverage'], function(){
return gulp.src('test/index.js')
.pipe($.mocha({
reporter: 'spec',
bail: true
}))
.pipe($.istanbul.writeReports());
});
gulp.task('jshint', function(){
return gulp.src('lib/*.js')
.pipe($.jshint())
.pipe($.jshint.reporter('jshint-stylish'))
.pipe($.jshint.reporter('fail'));
});
gulp.task('watch', function(){
gulp.watch('lib/*.js', ['mocha', 'jshint']);
gulp.watch(['test/index.js'], ['mocha']);
});
gulp.task('test', ['mocha', 'jshint']);