mirror of
https://github.com/orbitdb/orbitdb.git
synced 2025-06-24 23:12:29 +00:00
Remove obsolete timeout, fix couple of typos in tests
This commit is contained in:
parent
0638fc675b
commit
0fd5287c8c
@ -50,7 +50,7 @@ describe('OrbitDB', function () {
|
|||||||
|
|
||||||
it('has the IPFS instance given as a parameter', async () => {
|
it('has the IPFS instance given as a parameter', async () => {
|
||||||
const { id: expectedId } = ipfs1.libp2p.peerId
|
const { id: expectedId } = ipfs1.libp2p.peerId
|
||||||
const { id: resultId } = ipfs1.libp2p.peerId
|
const { id: resultId } = orbitdb1.ipfs.libp2p.peerId
|
||||||
strictEqual(expectedId, resultId)
|
strictEqual(expectedId, resultId)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -62,7 +62,7 @@ describe('Sync protocol', function () {
|
|||||||
await sync.stop()
|
await sync.stop()
|
||||||
}
|
}
|
||||||
if (log) {
|
if (log) {
|
||||||
await log.close
|
await log.close()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -14,29 +14,18 @@ const connectIpfsNodes = async (ipfs1, ipfs2, options = {
|
|||||||
|
|
||||||
await ipfs1.libp2p.dial(multiaddr(`/ip4/127.0.0.1/tcp/12345/ws/p2p/${relayId}`))
|
await ipfs1.libp2p.dial(multiaddr(`/ip4/127.0.0.1/tcp/12345/ws/p2p/${relayId}`))
|
||||||
|
|
||||||
let a1
|
let address1
|
||||||
|
|
||||||
await waitFor(() => {
|
await waitFor(() => {
|
||||||
a1 = ipfs1.libp2p.getMultiaddrs().filter(ma => WebRTC.matches(ma)).pop()
|
address1 = ipfs1.libp2p.getMultiaddrs().filter(ma => WebRTC.matches(ma)).pop()
|
||||||
|
return address1 != null
|
||||||
if (a1 != null) {
|
|
||||||
return true
|
|
||||||
} else {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}, () => true)
|
}, () => true)
|
||||||
|
|
||||||
await ipfs2.libp2p.dial(a1)
|
await ipfs2.libp2p.dial(address1)
|
||||||
} else {
|
} else {
|
||||||
await ipfs2.libp2p.peerStore.save(ipfs1.libp2p.peerId, { multiaddrs: ipfs1.libp2p.getMultiaddrs().filter(options.filter) })
|
await ipfs2.libp2p.peerStore.save(ipfs1.libp2p.peerId, { multiaddrs: ipfs1.libp2p.getMultiaddrs().filter(options.filter) })
|
||||||
await ipfs2.libp2p.dial(ipfs1.libp2p.peerId)
|
await ipfs2.libp2p.dial(ipfs1.libp2p.peerId)
|
||||||
}
|
}
|
||||||
|
|
||||||
return new Promise((resolve) => {
|
|
||||||
setTimeout(() => {
|
|
||||||
resolve()
|
|
||||||
}, 1000)
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default connectIpfsNodes
|
export default connectIpfsNodes
|
||||||
|
Loading…
x
Reference in New Issue
Block a user