-
Notifications
You must be signed in to change notification settings - Fork 12
/
gulpfile.js
31 lines (28 loc) · 880 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
var gulp = require('gulp');
var jasmine = require('gulp-jasmine');
var istanbul = require('gulp-istanbul');
function errorHandler(err){
console.log(err);
this.emit('end');
}
errorHandler.bind(gulp);
gulp.task('test', function (done) {
gulp.src('index.js')
.pipe(istanbul())
.pipe(istanbul.hookRequire())
.on('finish', function () {
gulp.src('test/*.js')
.pipe(jasmine({
verbose: true
}))
.on('error', errorHandler)
.pipe(istanbul.writeReports({
dir : './coverage'
}))
.on('error', errorHandler)
.on('end', done);
});
});
gulp.task('tdd', function () {
gulp.watch(['index.js', 'test/*.js'], ['test']);
});