-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
32 lines (24 loc) · 657 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 gulpFilter = require('gulp-filter');
var react = require('gulp-react');
var mocha = require('gulp-mocha');
var paths = {
src: './src',
target: './target'
};
gulp.task('test', function() {
var testFilter = gulpFilter('test/js/**/*.js');
gulp.src([paths.src + '/**/*.js'])
// transform jsx to js
.pipe(react())
// copy into target
.pipe(gulp.dest(paths.target))
// run tests
.pipe(testFilter)
.pipe(mocha())
.on('error', console.warn.bind(console));
});
gulp.task('watch', function() {
gulp.watch(paths.src + '/**/*.js', ['test']);
});
gulp.task('default', ['test', 'watch']);