Reduce test verbosity

This commit is contained in:
Franck Royer 2021-03-10 14:56:12 +11:00
parent dfe08058d9
commit b5bf5c03ab
No known key found for this signature in database
GPG Key ID: A82ED75A8DFC50A4
1 changed files with 3 additions and 3 deletions

View File

@ -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);
});
}