forked from amazon-connect/amazon-connect-streams
-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
61 lines (54 loc) · 1.53 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
51
52
53
54
55
56
57
58
59
60
61
var istanbul = require('gulp-istanbul'),
mocha = require('gulp-mocha'),
concat = require('gulp-concat'),
gulp = require('gulp'),
uglify = require('gulp-uglify'),
rename = require('gulp-rename'),
watch = require('gulp-watch'),
jshint = require('gulp-jshint'),
pump = require('pump');
var source = [ "src/aws-client.js",
"src/sprintf.js",
"src/log.js",
"src/util.js",
"src/event.js",
"src/streams.js",
"src/client.js",
"src/transitions.js",
"src/api.js",
"src/lib/amazon-connect-websocket-manager.js",
"src/core.js",
"src/ringtone.js",
"src/softphone.js",
"src/worker.js",
"src/mediaControllers/*",
];
gulp.task('pre-test', function () {
return gulp.src(['./src/*.js'])
// Covering files
.pipe(istanbul({includeUntested: false}))
// Force `require` to return covered files
.pipe(istanbul.hookRequire());
});
gulp.task('test', gulp.series('pre-test', function () {
return gulp.src(['test/unit/**/*.spec.js'])
.pipe(mocha({exit: true, showStack:true}))
.on('error', console.error)
// Creating the reports after tests ran
.pipe(istanbul.writeReports());
}));
gulp.task('watch', function() {
gulp.watch('src/*.js', gulp.series('script'));
});
gulp.task('script', function (cb) {
pump([
gulp.src(source),
jshint(),
concat('connect-streams.js'),
gulp.dest('./release/'),
rename('connect-streams-min.js'),
uglify(),
gulp.dest('./release/')
], cb);
});
gulp.task('default',gulp.series('test','script'));