forked from amazon-connect/amazon-connect-streams
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
48 lines (43 loc) · 1.23 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
var istanbul = require('gulp-istanbul'),
mocha = require('gulp-mocha'),
concat = require('gulp-concat'),
gulp = require('gulp'),
uglify = require('gulp-uglify'),
rename = require('gulp-rename');
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/core.js",
"src/ringtone.js",
"src/softphone.js",
"src/worker.js"
];
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', ['pre-test'], function () {
return gulp.src(['test/unit/*.js'])
.pipe(mocha({exit: true, showStack:true}))
.on('error', console.error)
// Creating the reports after tests ran
.pipe(istanbul.writeReports());
});
gulp.task('script', function() {
return gulp.src(source)
.pipe(concat('connect-streams.js'))
.pipe(gulp.dest('./release/'))
.pipe(rename('connect-streams-min.js'))
.pipe(uglify())
.pipe(gulp.dest('./release/'))
});
gulp.task('default',['test','script']);