Skip to content

Commit

Permalink
test(fix): reset multiaddrs on dial test
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobheun committed Nov 29, 2019
1 parent 6f197b7 commit 5b2386d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions test/dialing/relay.node.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ describe('Dialing (via relay, TCP)', () => {
;[srcLibp2p, relayLibp2p, dstLibp2p] = peerInfos.map((peerInfo, index) => {
const opts = baseOptions
index === 1 && (opts.config.relay.hop.enabled = true)
peerInfo.multiaddrs.add('/ip4/0.0.0.0/tcp/0')
return new Libp2p({
...opts,
peerInfo
Expand All @@ -38,7 +37,12 @@ describe('Dialing (via relay, TCP)', () => {

beforeEach(() => {
// Start each node
return Promise.all([srcLibp2p, relayLibp2p, dstLibp2p].map(libp2p => libp2p.start()))
return Promise.all([srcLibp2p, relayLibp2p, dstLibp2p].map(libp2p => {
// Reset multiaddrs and start
libp2p.peerInfo.multiaddrs.clear()
libp2p.peerInfo.multiaddrs.add('/ip4/0.0.0.0/tcp/0')
libp2p.start()
}))
})

afterEach(() => {
Expand Down

0 comments on commit 5b2386d

Please sign in to comment.