forked from seeden/react-facebook
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
50 lines (44 loc) · 1.01 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
45
46
47
48
49
50
import gulp from 'gulp';
import babel from 'gulp-babel';
import jsxCoverage from 'gulp-jsx-coverage';
import path from 'path';
import coveralls from 'gulp-coveralls';
gulp.task('test', jsxCoverage.createTask({
src: ['./tests/**/*{.js,.jsx}'],
istanbul: {
preserveComments: true,
coverageVariable: '__MY_TEST_COVERAGE__',
exclude: /node_modules|test[0-9]/,
},
threshold: 50,
thresholdType: 'lines',
transpile: {
babel: {
include: /\.jsx?$/,
exclude: /node_modules/,
omitExt: false,
},
},
coverage: {
reporters: ['text-summary', 'json', 'lcov'],
directory: 'coverage',
},
mocha: {
reporter: 'spec',
},
}));
gulp.task('build', () =>
gulp.src('./src/**/*.{js,jsx}')
.pipe(babel())
.pipe(gulp.dest('./dist'))
);
gulp.task('coveralls', ['test'], () => {
if (!process.env.CI) {
return void 0;
}
return gulp.src(path.join(__dirname, 'coverage/lcov.info'))
.pipe(coveralls());
});
gulp.doneCallback = (err) => {
process.exit(err ? 1 : 0);
};