Await async function

master
Frédéric Matte 2022-12-12 02:30:29 -05:00
parent 05dbd28c1d
commit b9018ba53a
1 changed files with 5 additions and 5 deletions

View File

@ -43,7 +43,7 @@ const metaltest = (title) => {
} }
runner.run = async (...reporters) => { runner.run = async (...reporters) => {
notify(reporters, 'start', title) await notify(reporters, 'start', title)
const tests = only.length ? only : suite const tests = only.length ? only : suite
for (const test of tests) { for (const test of tests) {
@ -55,7 +55,7 @@ const metaltest = (title) => {
} }
catch (error) { catch (error) {
stats('fail', test, 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()) await test.fn(stats())
stats('success', test) stats('success', test)
notify(reporters, 'success', test) await notify(reporters, 'success', test)
} catch (error) { } catch (error) {
stats('fail', test, error) stats('fail', test, error)
notify(reporters, 'fail', test, error) await notify(reporters, 'fail', test, error)
} }
} }
for (const fn of after) await fn() for (const fn of after) await fn()
const r = stats() const r = stats()
notify(reporters, 'end', r) await notify(reporters, 'end', r)
return r return r
} }