From b9018ba53ae6bb4e9fd8eab31ac39169512fb316 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Matte?= Date: Mon, 12 Dec 2022 02:30:29 -0500 Subject: [PATCH] Await async function --- lib/metaltest.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/metaltest.js b/lib/metaltest.js index 8e5aa64..8c3dbbc 100644 --- a/lib/metaltest.js +++ b/lib/metaltest.js @@ -43,7 +43,7 @@ const metaltest = (title) => { } runner.run = async (...reporters) => { - notify(reporters, 'start', title) + await notify(reporters, 'start', title) const tests = only.length ? only : suite for (const test of tests) { @@ -55,7 +55,7 @@ const metaltest = (title) => { } catch (error) { stats('fail', test, error) - notify(reporters, 'fail', test, error) + await notify(reporters, 'fail', test, error) } } @@ -64,17 +64,17 @@ const metaltest = (title) => { await test.fn(stats()) stats('success', test) - notify(reporters, 'success', test) + await notify(reporters, 'success', test) } catch (error) { stats('fail', test, error) - notify(reporters, 'fail', test, error) + await notify(reporters, 'fail', test, error) } } for (const fn of after) await fn() const r = stats() - notify(reporters, 'end', r) + await notify(reporters, 'end', r) return r }