Skip to content

Commit

Permalink
chore: fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
danisharora099 committed Jul 17, 2024
1 parent f565e10 commit c0822ae
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions packages/tests/tests/filter/peer_management.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,11 @@ describe("Waku Filter: Peer Management: E2E", function () {
undefined,
2
);
const serviceNodesPeerIdStr = await Promise.all(
serviceNodes.nodes.map(async (node) =>
(await node.getPeerId()).toString()
)
);
const nodeWithoutDiscovery = new ServiceNode("WithoutDiscovery");
await nodeWithoutDiscovery.start({ lightpush: true, filter: true });
const nodeWithouDiscoveryPeerIdStr = (
Expand Down Expand Up @@ -216,17 +221,12 @@ describe("Waku Filter: Peer Management: E2E", function () {
await sendMessage();

successes
.map(async (peerId) =>
[
nodeWithouDiscoveryPeerIdStr,
serviceNodes.nodes.map(async (node) =>
(await node.getPeerId()).toString()
)
]
.flat()
.includes(peerId.toString())
.map((peerId) =>
[nodeWithouDiscoveryPeerIdStr, ...serviceNodesPeerIdStr].includes(
peerId.toString()
)
)
.forEach((isConnected) => expect(isConnected).to.be.true);
.forEach((isConnected) => expect(isConnected).to.eq(true));

// send 2 more messages
await sendMessage();
Expand Down

0 comments on commit c0822ae

Please sign in to comment.