Skip to content

Commit

Permalink
sleep before checking logged message
Browse files Browse the repository at this point in the history
  • Loading branch information
milesstoetzner committed Sep 24, 2023
1 parent a1246ee commit 9e8e925
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/bridge/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,11 @@ export function createBidirectionalBridgeTest(

// Receives "request" and returns "answer"
const receiver = can.createRawChannelWithOptions(cans[1], {non_block_send: true})
receiver.addListener('onMessage', function (message: CANMessage) {
receiver.addListener('onMessage', async function (message: CANMessage) {
std.log('receiver received', {message})

await utils.sleep(250)

std.log('ensuring that received message is request')
expect(Message.fromCAN(message).toString(), 'received message is not request').to.equal(
request.toString()
Expand Down

0 comments on commit 9e8e925

Please sign in to comment.