test: use port 0

docs: add some more jsdocs

License: MIT
Signed-off-by: Jacob Heun <jacobheun@gmail.com>
This commit is contained in:
Jacob Heun
2019-04-19 11:00:51 +02:00
parent 330853f470
commit 1eca9d656e
2 changed files with 21 additions and 4 deletions

View File

@ -183,7 +183,7 @@ describe('dial', () => {
handled = resolve
})
const ma = multiaddr('/ip6/::/tcp/9067')
const ma = multiaddr('/ip6/::/tcp/0')
const listener = tcp.createListener(async (conn) => {
await pipe(
@ -194,7 +194,8 @@ describe('dial', () => {
})
await listener.listen(ma)
await pipe(await tcp.dial(ma))
const addrs = listener.getAddrs()
await pipe(await tcp.dial(addrs[0]))
await handledPromise
await listener.close()
@ -210,7 +211,7 @@ describe('dial', () => {
handled = resolve
})
const ma = multiaddr('/ip6/::/tcp/9068')
const ma = multiaddr('/ip6/::/tcp/0')
const listener = tcp.createListener(async (conn) => {
// pull(conn, pull.onEnd(destroyed))
@ -219,7 +220,8 @@ describe('dial', () => {
})
await listener.listen(ma)
await pipe([], await tcp.dial(ma))
const addrs = listener.getAddrs()
await pipe([], await tcp.dial(addrs[0]))
await handledPromise
await listener.close()