mirror of https://github.com/status-im/js-waku.git
Remove fixed time delays
This commit is contained in:
parent
953aeea053
commit
b2632af04b
|
@ -2,7 +2,6 @@ import test from 'ava';
|
||||||
import Libp2p from 'libp2p';
|
import Libp2p from 'libp2p';
|
||||||
import Pubsub from 'libp2p-interfaces/src/pubsub';
|
import Pubsub from 'libp2p-interfaces/src/pubsub';
|
||||||
|
|
||||||
import { delay } from '../test_utils/delay';
|
|
||||||
import { NimWaku } from '../test_utils/nim_waku';
|
import { NimWaku } from '../test_utils/nim_waku';
|
||||||
|
|
||||||
import { createNode } from './node';
|
import { createNode } from './node';
|
||||||
|
@ -145,14 +144,14 @@ test('Nim-interop: nim node sends message to js node', async (t) => {
|
||||||
|
|
||||||
await wakuRelayNode.subscribe();
|
await wakuRelayNode.subscribe();
|
||||||
|
|
||||||
await delay(3000);
|
await new Promise((resolve) =>
|
||||||
|
node.pubsub.once('gossipsub:heartbeat', resolve)
|
||||||
|
);
|
||||||
|
|
||||||
const receivedPromise = waitForNextData(node.pubsub);
|
const receivedPromise = waitForNextData(node.pubsub);
|
||||||
|
|
||||||
await nimWaku.sendMessage(message);
|
await nimWaku.sendMessage(message);
|
||||||
|
|
||||||
await delay(3000);
|
|
||||||
|
|
||||||
const receivedMsg = await receivedPromise;
|
const receivedMsg = await receivedPromise;
|
||||||
|
|
||||||
t.is(receivedMsg.contentTopic, message.contentTopic);
|
t.is(receivedMsg.contentTopic, message.contentTopic);
|
||||||
|
|
Loading…
Reference in New Issue