mirror of
https://github.com/fluencelabs/js-libp2p-tcp
synced 2025-04-25 17:22:30 +00:00
test: add multiaddr7 dial test
License: MIT Signed-off-by: Jacob Heun <jacobheun@gmail.com>
This commit is contained in:
parent
5429c409db
commit
bf532d181a
@ -9,6 +9,7 @@ chai.use(dirtyChai)
|
||||
const TCP = require('../src')
|
||||
const net = require('net')
|
||||
const multiaddr = require('multiaddr')
|
||||
const multiaddr7 = require('multiaddr7')
|
||||
const isCI = process.env.CI
|
||||
|
||||
describe('listen', () => {
|
||||
@ -256,4 +257,19 @@ describe('dial', () => {
|
||||
})
|
||||
)
|
||||
})
|
||||
|
||||
it('dial on IPv4 with IPFS Id multiaddr7', (done) => {
|
||||
const ma = multiaddr7('/ip4/127.0.0.1/tcp/9090/p2p/Qmb6owHp6eaWArVbcJJbQSyifyJBttMMjYV76N2hMbf5Vw')
|
||||
const conn = tcp.dial(ma)
|
||||
|
||||
pull(
|
||||
pull.values(['hey']),
|
||||
conn,
|
||||
pull.collect((err, res) => {
|
||||
expect(err).to.not.exist()
|
||||
expect(res).to.be.eql([Buffer.from('hey!')])
|
||||
done()
|
||||
})
|
||||
)
|
||||
})
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user