mirror of https://github.com/waku-org/js-waku.git
Ensure relay peers are available before starting the test (#431)
This commit is contained in:
parent
1f0f96e66f
commit
199a3c7218
|
@ -41,10 +41,11 @@ describe('Waku Message [node only]', function () {
|
||||||
await waku.dial(await nimWaku.getMultiaddrWithId());
|
await waku.dial(await nimWaku.getMultiaddrWithId());
|
||||||
await waku.waitForConnectedPeer([RelayCodecs]);
|
await waku.waitForConnectedPeer([RelayCodecs]);
|
||||||
|
|
||||||
// Wait for one heartbeat to ensure mesh is updated
|
let peers = await waku.relay.getPeers();
|
||||||
await new Promise((resolve) =>
|
while (peers.size === 0) {
|
||||||
waku.libp2p.pubsub.once('gossipsub:heartbeat', resolve)
|
await delay(200);
|
||||||
);
|
peers = await waku.relay.getPeers();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
afterEach(async function () {
|
afterEach(async function () {
|
||||||
|
@ -53,8 +54,7 @@ describe('Waku Message [node only]', function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('JS decrypts nim message [asymmetric, no signature]', async function () {
|
it('JS decrypts nim message [asymmetric, no signature]', async function () {
|
||||||
this.timeout(10000);
|
this.timeout(5000);
|
||||||
await delay(200);
|
|
||||||
|
|
||||||
const messageText = 'Here is an encrypted message.';
|
const messageText = 'Here is an encrypted message.';
|
||||||
const message: WakuRelayMessage = {
|
const message: WakuRelayMessage = {
|
||||||
|
@ -114,8 +114,7 @@ describe('Waku Message [node only]', function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('JS decrypts nim message [symmetric, no signature]', async function () {
|
it('JS decrypts nim message [symmetric, no signature]', async function () {
|
||||||
this.timeout(10000);
|
this.timeout(5000);
|
||||||
await delay(200);
|
|
||||||
|
|
||||||
const messageText = 'Here is a message encrypted in a symmetric manner.';
|
const messageText = 'Here is a message encrypted in a symmetric manner.';
|
||||||
const message: WakuRelayMessage = {
|
const message: WakuRelayMessage = {
|
||||||
|
|
Loading…
Reference in New Issue