Skip to content

Commit

Permalink
test fix: avoiding conflating addresses in testing multiaddr trimming
Browse files Browse the repository at this point in the history
  • Loading branch information
pgte committed Dec 1, 2017
1 parent ee65d2f commit 56adc4b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/multiaddr-trim.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ describe('multiaddr trim', () => {
it('can create a test node with an irrelevant multiaddr', (done) => {
createNode(
[
'/ip4/0.0.0.0/tcp/0/wss/p2p-webrtc-direct',
'/ip4/0.0.0.0/tcp/0'
'/ip4/0.0.0.0/tcp/999/wss/p2p-webrtc-direct',
'/ip4/127.0.0.1/tcp/0'
],
(err, _node) => {
expect(err).to.not.exist()
Expand All @@ -37,7 +37,7 @@ describe('multiaddr trim', () => {

it('irrelevant multiaddr got trimmed', (done) => {
expect(node.peerInfo.multiaddrs.toArray()).to.have.length(1)
expect(node.peerInfo.multiaddrs.toArray()[0].toString()).to.match(/^\/ip4\/0\.0\.0\.0\/tcp\/0\/ipfs\/\w+/)
expect(node.peerInfo.multiaddrs.toArray()[0].toString()).to.match(/^\/ip4\/127\.0\.0\.1\/tcp\/[0-9]+\/ipfs\/\w+$/)
done()
})
})

0 comments on commit 56adc4b

Please sign in to comment.