Check subscribers until it finds one

This commit is contained in:
Franck Royer 2021-04-29 16:38:50 +10:00
parent 0270003556
commit 5664c14743
No known key found for this signature in database
GPG Key ID: A82ED75A8DFC50A4
1 changed files with 6 additions and 3 deletions

View File

@ -195,9 +195,12 @@ describe('Waku Relay', () => {
});
it('nim subscribes to js', async function () {
const subscribers = waku.libp2p.pubsub.getSubscribers(
RelayDefaultTopic
);
let subscribers: string[] = [];
while (subscribers.length === 0) {
await delay(200);
subscribers = waku.libp2p.pubsub.getSubscribers(RelayDefaultTopic);
}
const nimPeerId = await nimWaku.getPeerId();
expect(subscribers).to.contain(nimPeerId.toB58String());