You can pass the tests directly
parent
73b1b24e71
commit
4f096bd848
|
@ -10,8 +10,12 @@ import { errorreporter, summaryreporter } from '../index.js'
|
||||||
const runifmain = async (meta, fn, ...args) => {
|
const runifmain = async (meta, fn, ...args) => {
|
||||||
if (!isMain(meta)) return
|
if (!isMain(meta)) return
|
||||||
|
|
||||||
if (args.length == 0) args.push(summaryreporter(), errorreporter())
|
if (fn.name === 'runner' && fn.run) {
|
||||||
await fn(...args)
|
if (args.length == 0) args.push(summaryreporter(), errorreporter())
|
||||||
|
await fn.run(...args)
|
||||||
|
} else {
|
||||||
|
await fn(...args)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export { runifmain }
|
export { runifmain }
|
||||||
|
|
Loading…
Reference in New Issue