mirror of
https://github.com/fluencelabs/js-libp2p
synced 2025-03-30 22:31:03 +00:00
test(fix): fix listening test for ci
This commit is contained in:
parent
8b94cd1e2e
commit
29a96690ad
@ -41,16 +41,13 @@ describe('Listening', () => {
|
|||||||
// Should get something like:
|
// Should get something like:
|
||||||
// /ip4/127.0.0.1/tcp/50866
|
// /ip4/127.0.0.1/tcp/50866
|
||||||
// /ip4/192.168.1.2/tcp/50866
|
// /ip4/192.168.1.2/tcp/50866
|
||||||
expect(addrs.length).to.equal(2)
|
expect(addrs.length).to.be.at.least(2)
|
||||||
|
for (const addr of addrs) {
|
||||||
const opts = [addrs[0].toOptions(), addrs[1].toOptions()]
|
const opts = addr.toOptions()
|
||||||
expect(opts[0].family).to.equal('ipv4')
|
expect(opts.family).to.equal('ipv4')
|
||||||
expect(opts[1].family).to.equal('ipv4')
|
expect(opts.transport).to.equal('tcp')
|
||||||
expect(opts[0].transport).to.equal('tcp')
|
expect(opts.host).to.match(/[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+/)
|
||||||
expect(opts[1].transport).to.equal('tcp')
|
expect(opts.port).to.be.gt(0)
|
||||||
expect(opts[0].host).to.match(/[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+/)
|
}
|
||||||
expect(opts[1].host).to.match(/[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+/)
|
|
||||||
expect(opts[0].port).to.be.gt(0)
|
|
||||||
expect(opts[1].port).to.be.gt(0)
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user