You can pass the tests directly

master
Frédéric Matte 2023-09-30 04:56:59 -04:00
parent 73b1b24e71
commit 4f096bd848
1 changed files with 6 additions and 2 deletions

View File

@ -10,8 +10,12 @@ import { errorreporter, summaryreporter } from '../index.js'
const runifmain = async (meta, fn, ...args) => {
if (!isMain(meta)) return
if (fn.name === 'runner' && fn.run) {
if (args.length == 0) args.push(summaryreporter(), errorreporter())
await fn.run(...args)
} else {
await fn(...args)
}
}
export { runifmain }