forked from libp2p/js-libp2p-webrtc-star
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
63 lines (55 loc) · 1.1 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
62
63
'use strict'
const gulp = require('gulp')
const parallel = require('async/parallel')
const sigServer = require('./src/signalling')
let sigS, sigS2
gulp.task('test:node:before', boot)
gulp.task('test:node:after', stop)
gulp.task('test:browser:before', boot)
gulp.task('test:browser:after', stop)
function boot (done) {
const options = {
port: 15555,
host: '127.0.0.1'
}
const options2 = {
port: 15556,
host: '127.0.0.1'
}
parallel([
first,
second
], done)
function first () {
sigServer.start(options, (err, server) => {
if (err) {
throw err
}
sigS = server
console.log('signalling on:', server.info.uri)
})
}
function second () {
sigServer.start(options2, (err, server) => {
if (err) {
throw err
}
sigS2 = server
console.log('signalling 2 on:', server.info.uri)
done()
})
}
}
function stop (done) {
parallel([
first,
second
], done)
function first (done) {
sigS.stop(() => done())
}
function second (done) {
sigS2.stop(() => done())
}
}
require('aegir/gulp')(gulp)