Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace continuables with async-await in tests #43

Merged
merged 8 commits into from
Jun 15, 2021
Merged
Changes from 1 commit
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
11 changes: 6 additions & 5 deletions test/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,17 +111,18 @@ tape('alice blocks bob, and bob cannot connect to alice', async (t) => {
t.end()
})

tape('carol does not let bob replicate with alice', async (t) => {
tape('carol does replicate alice\'s data with bob', async (t) => {
staltz marked this conversation as resolved.
Show resolved Hide resolved
t.plan(1)
// first, carol should have already replicated with alice.
// emits this event when did not allow bob to get this data.
await Promise.all([
pify(bob.connect)(carol.getAddress()),
sleep(REPLICATION_TIMEOUT),
])
const rpcBobToCarol = await pify(bob.connect)(carol.getAddress())
await sleep(REPLICATION_TIMEOUT)

await pify(rpcBobToCarol.close)(true)

const clock = await pify(bob.getVectorClock)()
t.equal(clock[alice.id], 1)

t.end()
})

Expand Down