mirror of
https://github.com/fluencelabs/js-libp2p
synced 2025-06-15 02:01:21 +00:00
fix: dont call callback before it's properly set
This commit is contained in:
@ -266,4 +266,29 @@ describe('.peerRouting', () => {
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('no routers', () => {
|
||||
let nodeA
|
||||
before((done) => {
|
||||
createNode('/ip4/0.0.0.0/tcp/0', (err, node) => {
|
||||
expect(err).to.not.exist()
|
||||
nodeA = node
|
||||
done()
|
||||
})
|
||||
})
|
||||
|
||||
it('.findPeer should return an error with no options', (done) => {
|
||||
nodeA.peerRouting.findPeer('a cid', (err) => {
|
||||
expect(err).to.exist()
|
||||
done()
|
||||
})
|
||||
})
|
||||
|
||||
it('.findPeer should return an error with options', (done) => {
|
||||
nodeA.peerRouting.findPeer('a cid', { maxTimeout: 5000 }, (err) => {
|
||||
expect(err).to.exist()
|
||||
done()
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
Reference in New Issue
Block a user