Add some awaits

This commit is contained in:
Franck Royer 2022-05-26 15:05:18 +10:00
parent e5dde6f9e9
commit 4cf3d3ffd8
No known key found for this signature in database
GPG Key ID: A82ED75A8DFC50A4

View File

@ -50,7 +50,7 @@ describe("Waku Filter", () => {
messageText, messageText,
TestContentTopic TestContentTopic
); );
waku.relay.send(message); await waku.relay.send(message);
while (messageCount === 0) { while (messageCount === 0) {
await delay(250); await delay(250);
} }
@ -69,10 +69,10 @@ describe("Waku Filter", () => {
{ contentTopics: [TestContentTopic] }, { contentTopics: [TestContentTopic] },
callback callback
); );
waku.relay.send( await waku.relay.send(
await WakuMessage.fromUtf8String("Filtering works!", TestContentTopic) await WakuMessage.fromUtf8String("Filtering works!", TestContentTopic)
); );
waku.relay.send( await waku.relay.send(
await WakuMessage.fromUtf8String( await WakuMessage.fromUtf8String(
"Filtering still works!", "Filtering still works!",
TestContentTopic TestContentTopic
@ -93,7 +93,7 @@ describe("Waku Filter", () => {
{ contentTopics: [TestContentTopic] }, { contentTopics: [TestContentTopic] },
callback callback
); );
waku.relay.send( await waku.relay.send(
await WakuMessage.fromUtf8String( await WakuMessage.fromUtf8String(
"This should be received", "This should be received",
TestContentTopic TestContentTopic
@ -101,7 +101,7 @@ describe("Waku Filter", () => {
); );
await delay(100); await delay(100);
await unsubscribe(); await unsubscribe();
waku.relay.send( await waku.relay.send(
await WakuMessage.fromUtf8String( await WakuMessage.fromUtf8String(
"This should not be received", "This should not be received",
TestContentTopic TestContentTopic