Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

fix: await on things that need awaiting on #2773

Merged
merged 1 commit into from
Feb 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions test/core/bitswap.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe('bitswap', function () {
it('2 peers', async function () {
const remote = (await df.spawn({ type: 'js' })).api
const proc = (await df.spawn({ type: 'proc' })).api
proc.swarm.connect(remote.peerId.addresses[0])
await proc.swarm.connect(remote.peerId.addresses[0])
const block = await makeBlock()

await proc.block.put(block)
Expand All @@ -41,9 +41,9 @@ describe('bitswap', function () {
const remote1 = (await df.spawn({ type: 'js' })).api
const remote2 = (await df.spawn({ type: 'js' })).api
const proc = (await df.spawn({ type: 'proc' })).api
proc.swarm.connect(remote1.peerId.addresses[0])
proc.swarm.connect(remote2.peerId.addresses[0])
remote1.swarm.connect(remote2.peerId.addresses[0])
await proc.swarm.connect(remote1.peerId.addresses[0])
await proc.swarm.connect(remote2.peerId.addresses[0])
await remote1.swarm.connect(remote2.peerId.addresses[0])

await remote1.block.put(blocks[0])
await remote1.block.put(blocks[1])
Expand All @@ -68,7 +68,7 @@ describe('bitswap', function () {
const file = Buffer.from(`I love IPFS <3 ${hat()}`)
const remote = (await df.spawn({ type: 'js' })).api
const proc = (await df.spawn({ type: 'proc' })).api
proc.swarm.connect(remote.peerId.addresses[0])
await proc.swarm.connect(remote.peerId.addresses[0])

const files = await all(remote.add([{ path: 'awesome.txt', content: file }]))
const data = await concat(proc.cat(files[0].cid))
Expand Down
6 changes: 3 additions & 3 deletions test/core/name.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ describe('name', function () {
nodeB = (await createNode()).api
nodeC = (await createNode()).api

nodeC.swarm.connect(nodeA.peerId.addresses[0]) // C => A
nodeC.swarm.connect(nodeB.peerId.addresses[0]) // C => B
nodeA.swarm.connect(nodeB.peerId.addresses[0]) // A => B
await nodeC.swarm.connect(nodeA.peerId.addresses[0]) // C => A
await nodeC.swarm.connect(nodeB.peerId.addresses[0]) // C => B
await nodeA.swarm.connect(nodeB.peerId.addresses[0]) // A => B
})

after(() => df.clean())
Expand Down