mirror of
https://github.com/fluencelabs/js-libp2p
synced 2025-03-16 15:40:49 +00:00
test: improve multiaddr trim test
This commit is contained in:
parent
92cd591da4
commit
88ebd1fc09
@ -29,10 +29,12 @@ describe('multiaddr trim', () => {
|
||||
expect(err).to.not.exist()
|
||||
|
||||
const multiaddrs = node.peerInfo.multiaddrs.toArray()
|
||||
expect(multiaddrs.length).to.be.at.least(2)
|
||||
// ensure the p2p-webrtc-direct address has been trimmed
|
||||
multiaddrs.forEach((addr) => {
|
||||
expect(() => addr.decapsulate('/ip4/0.0.0.0/tcp/999/wss/p2p-webrtc-direct')).to.throw()
|
||||
})
|
||||
|
||||
expect(multiaddrs.length).to.at.least(2)
|
||||
expect(multiaddrs[0].toString())
|
||||
.to.match(/^\/ip4\/127\.0\.0\.1\/tcp\/[0-9]+\/ws\/ipfs\/\w+$/)
|
||||
node.stop(done)
|
||||
})
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user