diff --git a/packages/tests/src/lib/index.ts b/packages/tests/src/lib/index.ts index 550b77f88b..474f520483 100644 --- a/packages/tests/src/lib/index.ts +++ b/packages/tests/src/lib/index.ts @@ -103,21 +103,18 @@ export class ServiceNodesFleet { pubsubTopic?: string, raw = false ): Promise { - let relayMessagePromises: Promise[]; - if (raw) { - relayMessagePromises = this.nodes.map((node) => - node.rpcCall("post_waku_v2_relay_v1_message", [ - pubsubTopic && pubsubTopic, + const relayMessagePromises = this.nodes.map((node) => { + if (raw) { + return node.rpcCall("post_waku_v2_relay_v1_message", [ + pubsubTopic ?? pubsubTopic, message - ]) - ); - } else { - relayMessagePromises = this.nodes.map((node) => - node.sendMessage(message, pubsubTopic) - ); - } + ]); + } + return node.sendMessage(message, pubsubTopic); + }); + const relayMessages = await Promise.all(relayMessagePromises); - return relayMessages.every((message) => message); + return relayMessages.every(Boolean); // More concise way to check all true } async confirmMessageLength(numMessages: number): Promise { diff --git a/packages/tests/tests/store/cursor.node.spec.ts b/packages/tests/tests/store/cursor.node.spec.ts index f54b75e00a..b5d8ee0c4f 100644 --- a/packages/tests/tests/store/cursor.node.spec.ts +++ b/packages/tests/tests/store/cursor.node.spec.ts @@ -191,7 +191,7 @@ describe("Waku Store, cursor", function () { for await (const page of waku.store.queryGenerator([TestDecoder], { cursor })) { - page; + void page; } throw new Error("Cursor with wrong pubsubtopic was accepted"); } catch (err) { diff --git a/packages/tests/tests/store/error_handling.node.spec.ts b/packages/tests/tests/store/error_handling.node.spec.ts index 8f09ff0a60..354f795bc2 100644 --- a/packages/tests/tests/store/error_handling.node.spec.ts +++ b/packages/tests/tests/store/error_handling.node.spec.ts @@ -39,7 +39,7 @@ describe("Waku Store, error handling", function () { for await (const msgPromises of waku.store.queryGenerator([ customDecoder1 ])) { - msgPromises; + void msgPromises; } throw new Error("QueryGenerator was successful but was expected to fail"); } catch (err) { @@ -60,7 +60,7 @@ describe("Waku Store, error handling", function () { TestDecoder, customDecoder1 ])) { - msgPromises; + void msgPromises; } throw new Error("QueryGenerator was successful but was expected to fail"); } catch (err) { @@ -78,7 +78,7 @@ describe("Waku Store, error handling", function () { it("Query Generator, No Decoder", async function () { try { for await (const msgPromises of waku.store.queryGenerator([])) { - msgPromises; + void msgPromises; } throw new Error("QueryGenerator was successful but was expected to fail"); } catch (err) {