Skip to content

Commit 56adc4b

Browse files
committed
test fix: avoiding conflating addresses in testing multiaddr trimming
1 parent ee65d2f commit 56adc4b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/multiaddr-trim.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ describe('multiaddr trim', () => {
2020
it('can create a test node with an irrelevant multiaddr', (done) => {
2121
createNode(
2222
[
23-
'/ip4/0.0.0.0/tcp/0/wss/p2p-webrtc-direct',
24-
'/ip4/0.0.0.0/tcp/0'
23+
'/ip4/0.0.0.0/tcp/999/wss/p2p-webrtc-direct',
24+
'/ip4/127.0.0.1/tcp/0'
2525
],
2626
(err, _node) => {
2727
expect(err).to.not.exist()
@@ -37,7 +37,7 @@ describe('multiaddr trim', () => {
3737

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

0 commit comments

Comments
 (0)