-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgulpfile.js
44 lines (35 loc) · 1.13 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
var gulp = require("gulp");
var babel = require("gulp-babel");
var jasmine = require('gulp-jasmine');
var istanbul = require('gulp-istanbul');
var toc = require('gulp-doctoc');
gulp.task('transpile', function () {
return gulp.src(['lib/*.js', 'lib/*.js'])
.pipe(babel())
.pipe(gulp.dest('dist'));
});
gulp.task('test:build', ['build'], function () {
return gulp.src(['dist/*.js'])
// .pipe(babel())
.pipe(istanbul()) // Covering files
// .pipe(istanbul.hookRequire()) // Force `require` to return covered files
.pipe(gulp.dest('tests/lib'));
});
gulp.task('test', ['test:build'], function () {
return gulp.src(['tests/*.js'])
.pipe(jasmine())
.pipe(istanbul.writeReports()) // Creating the reports after tests ran
.on('end', console.log)
;
});
gulp.task('markdown', function(){
gulp.src('*.md')
.pipe(toc())
.pipe(gulp.dest('.'));
});
gulp.task('build', ['transpile']);
gulp.task('publish', ['test', 'build']);
gulp.task('watch', ['build'], function () {
//their could be more watchers here ofc
gulp.watch(['lib/*'], ['build']);
});