Await async function
parent
05dbd28c1d
commit
b9018ba53a
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue