forked from Shafied/testcafe-reporter-slack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gulpfile.js
42 lines (35 loc) · 1.11 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
const gulp = require('gulp');
const babel = require('gulp-babel');
const mocha = require('gulp-mocha');
const del = require('del');
gulp.task('clean', function (cb) {
del('lib', cb);
});
gulp.task('build', ['clean'], function () {
return gulp
.src('src/**/*.js')
.pipe(babel())
.pipe(gulp.dest('lib'));
});
gulp.task('watch', ['build'], function () {
gulp.watch('src/*.js', ['build']);
});
gulp.task('test', ['build'], function () {
return gulp
.src('test/**.js')
.pipe(mocha({
ui: 'bdd',
reporter: 'spec',
timeout: typeof v8debug === 'undefined' ? 2000 : Infinity // NOTE: disable timeouts in debug
}));
});
gulp.task('preview', ['build'], function () {
const buildReporterPlugin = require('testcafe').embeddingUtils.buildReporterPlugin;
const pluginFactory = require('./lib');
const reporterTestCalls = require('./test/utils/reporter-test-calls');
const plugin = buildReporterPlugin(pluginFactory);
reporterTestCalls.forEach(function (call) {
plugin[call.method].apply(plugin, call.args);
});
process.exit(0);
});