Add echo tests

This commit is contained in:
Francisco Baio Dias
2016-03-15 15:27:22 +00:00
parent 19bbe473d9
commit 3b81221566
2 changed files with 43 additions and 2 deletions

View File

@ -17,10 +17,10 @@ function WebSockets () {
options = {}
}
options.ready = options.ready || function noop () {}
options.connect = options.connect || function noop () {}
const maOpts = multiaddr.toOptions()
const conn = new SWS('ws://' + maOpts.host + ':' + maOpts.port)
conn.on('ready', options.ready)
conn.on('connect', options.connect)
conn.getObservedAddrs = () => {
return [multiaddr]
}