-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
48 lines (41 loc) · 1.04 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
var gulp = require('gulp');
var jshint = require('gulp-jshint');
var istanbul = require('gulp-istanbul');
var mocha = require('gulp-mocha');
var mdox = require('gulp-mdox');
var benchmark = require('gulp-bench');
var paths = {
src: ['*.js'],
tests: ['test/*.js'],
benchmarks: ['benchmark/hash.js']
};
gulp.task('lint', function(){
return gulp.src(paths.src)
.pipe(jshint())
.pipe(jshint.reporter('jshint-stylish'));
});
gulp.task('docs', function() {
return gulp.src('superhash.js')
.pipe(mdox({
name: "API.md",
github: true
}))
.pipe(gulp.dest("./"));
});
gulp.task('bench', function() {
return gulp.src(paths.benchmarks)
.pipe(benchmark());
});
gulp.task('test', function(){
return gulp.src(paths.src)
.pipe(istanbul())
.on('finish', function(){
gulp.src(paths.tests)
.pipe(mocha())
.pipe(istanbul.writeReports());
});
});
gulp.task('watch', function(){
gulp.watch([paths.src, paths.tests], ['lint', 'test', 'docs']);
});
gulp.task('default', ['lint', 'test', 'docs']);