mirror of
https://github.com/fluencelabs/js-libp2p
synced 2025-07-08 13:21:34 +00:00
Compare commits
1 Commits
v0.31.4
...
fix/return
Author | SHA1 | Date | |
---|---|---|---|
ed2dbd9bea |
@ -179,7 +179,7 @@ class AddressBook extends Book {
|
||||
const record = this.data.get(peerId.toB58String())
|
||||
|
||||
if (!record) {
|
||||
return undefined
|
||||
return []
|
||||
}
|
||||
|
||||
return record.map((address) => {
|
||||
|
@ -323,10 +323,10 @@ describe('addressBook', () => {
|
||||
throw new Error('invalid peerId should throw error')
|
||||
})
|
||||
|
||||
it('returns undefined if no multiaddrs are known for the provided peer', () => {
|
||||
it('returns empty array if no multiaddrs are known for the provided peer', () => {
|
||||
const addresses = ab.getMultiaddrsForPeer(peerId)
|
||||
|
||||
expect(addresses).to.not.exist()
|
||||
expect(addresses).to.be.empty()
|
||||
})
|
||||
|
||||
it('returns the multiaddrs stored', () => {
|
||||
|
Reference in New Issue
Block a user