-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
32 lines (28 loc) · 937 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
var gulp = require('gulp');
var mocha = require('gulp-mocha');
var gutil = require('gulp-util');
// Remove ugly stack trace (this is an ugly solution to an ugly problem)
console.oldError = console.error;
console.error = function() {
if (typeof arguments.stack !== 'undefined') {
console.oldError.call(console, arguments.stack);
} else {
if (typeof arguments[4] !== 'undefined') arguments[4] = "...";
console.oldError.apply(console, arguments);
}
}
gulp.task('mocha', function() {
return gulp.src(['test/**/*.js'], { read: false })
.pipe(mocha({
reporter: 'spec', // list ?
globals: {
should: require('should'),
},
}))
.on('error', gutil.log);
});
gulp.task('watch-mocha', function() {
gulp.watch(['./src/**/*.js', './test/**/*.js'], ['mocha']);
});
// Default Task
gulp.task('default', ['mocha', 'watch-mocha']);