-
Notifications
You must be signed in to change notification settings - Fork 451
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,15 +8,25 @@ const createNode = require('./utils/node').createNode | |
|
||
describe('multiaddr trim', () => { | ||
let node | ||
|
||
after((done) => { | ||
if (node) { | ||
node.stop(done) | ||
} else { | ||
done() | ||
} | ||
}) | ||
|
||
it('can create a test node with an irrelevant multiaddr', (done) => { | ||
createNode( | ||
[ | ||
'/ip4/0.0.0.0/tcp/0/p2p-webrtc-direct' | ||
'/ip4/0.0.0.0/tcp/0/wss/p2p-webrtc-direct', | ||
'/ip4/0.0.0.0/tcp/0' | ||
], | ||
(err, _node) => { | ||
expect(err).to.not.exist() | ||
node = _node | ||
expect(node.peerInfo.multiaddrs.toArray()).to.have.length(1) | ||
expect(node.peerInfo.multiaddrs.toArray()).to.have.length(2) | ||
done() | ||
}) | ||
}) | ||
|
@@ -26,7 +36,8 @@ describe('multiaddr trim', () => { | |
}) | ||
|
||
it('irrelevant multiaddr got trimmed', (done) => { | ||
expect(node.peerInfo.multiaddrs.toArray()).to.have.length(0) | ||
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+/) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
pgte
Author
Contributor
|
||
done() | ||
}) | ||
}) |
(my regex foo might be rusty) isn't this checking that 0.0.0.0 still continues there?