From bd5c617175bd2f12441577c9a67fd4b1347adbb3 Mon Sep 17 00:00:00 2001 From: danisharora099 Date: Sat, 15 Jul 2023 18:16:59 +0200 Subject: [PATCH] test --- packages/tests/tests/peer_exchange.node.spec.ts | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/packages/tests/tests/peer_exchange.node.spec.ts b/packages/tests/tests/peer_exchange.node.spec.ts index d879d01aaf..33cc14da5d 100644 --- a/packages/tests/tests/peer_exchange.node.spec.ts +++ b/packages/tests/tests/peer_exchange.node.spec.ts @@ -97,17 +97,18 @@ describe("Peer Exchange", () => { const nwaku2Ma = await nwaku2.getMultiaddrWithId(); waku = await createLightNode(); + + await new Promise((resolve) => { + waku.libp2p.addEventListener("peer:identify", (evt) => { + if (evt.detail.protocols.includes(PeerExchangeCodec)) { + resolve(); + } + }); + }); + await waku.start(); await waku.libp2p.dialProtocol(nwaku2Ma, PeerExchangeCodec); - // await new Promise((resolve) => { - // waku.libp2p.addEventListener("peer:identify", (evt) => { - // if (evt.detail.protocols.includes(PeerExchangeCodec)) { - // resolve(); - // } - // }); - // }); - const components = waku.libp2p.components as unknown as Libp2pComponents; const peerExchange = new WakuPeerExchange(components);