From b5bf5c03abc69c327f3ad182dcc20558a27ef5f0 Mon Sep 17 00:00:00 2001 From: Franck Royer Date: Wed, 10 Mar 2021 14:56:12 +1100 Subject: [PATCH] Reduce test verbosity --- src/lib/node.spec.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/node.spec.ts b/src/lib/node.spec.ts index f1734b2cc8..ba162fe7a5 100644 --- a/src/lib/node.spec.ts +++ b/src/lib/node.spec.ts @@ -23,9 +23,7 @@ test('Can publish message', async (t) => { // Setup the promise before publishing to ensure the event is not missed // TODO: Is it possible to import `Message` type? - const promise = waitForNextData(node1.pubsub, topic).then((msg: any) => { - return new TextDecoder().decode(msg.data); - }); + const promise = waitForNextData(node1.pubsub, topic); await delay(500); @@ -39,5 +37,7 @@ test('Can publish message', async (t) => { function waitForNextData(pubsub: Pubsub, topic: string) { return new Promise((resolve) => { pubsub.once(topic, resolve); + }).then((msg: any) => { + return new TextDecoder().decode(msg.data); }); }