Skip to content

Commit

Permalink
log join time in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dmotz committed Feb 11, 2024
1 parent cdff443 commit 6495007
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,12 @@ export default strategy =>
return new Promise(window.room.onPeerJoin)
}

const start = Date.now()
const [peer2Id, peer1Id] = await Promise.all([
page.evaluate(joinRoom, roomArgs),
page2.evaluate(joinRoom, roomArgs)
])
const joinTime = Date.now() - start

expect(peer1Id).toEqual(selfId1)
expect(peer2Id).toEqual(selfId2)
Expand Down Expand Up @@ -240,4 +242,6 @@ export default strategy =>
await page2.evaluate(() => window.room.leave())

expect(await peer1onLeaveId).toEqual(peer2Id)

console.log(` ⏱️ ${strategy.padEnd(12, ' ')} ${joinTime}ms`)
})

0 comments on commit 6495007

Please sign in to comment.