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