-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathGulpfile.js
More file actions
34 lines (30 loc) · 876 Bytes
/
Copy pathGulpfile.js
File metadata and controls
34 lines (30 loc) · 876 Bytes
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
var babel = require('gulp-babel');
var del = require('del');
var eslint = require('gulp-eslint');
var gulp = require('gulp');
var mocha = require('gulp-mocha');
gulp.task('lint', function () {
return gulp
.src(['src/**/*.js', 'test/**/*.js'])
.pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.failAfterError());
});
gulp.task('clean', function () {
return del('lib');
});
gulp.task('build', ['clean', 'lint'], function () {
return gulp
.src('src/**/*.js')
.pipe(babel())
.pipe(gulp.dest('./lib'));
});
gulp.task('test', ['build'], function () {
return gulp
.src('test/*-test.js')
.pipe(mocha({
ui: 'bdd',
reporter: 'spec',
timeout: typeof v8debug === 'undefined' ? 2000 : Infinity // NOTE: disable timeouts in debug
}));
});