Make summary and error the default reporters
parent
eade7e15b3
commit
73b1b24e71
|
@ -6,10 +6,12 @@ const isMain = (meta) => {
|
||||||
return path.includes(process.argv[1])
|
return path.includes(process.argv[1])
|
||||||
}
|
}
|
||||||
|
|
||||||
const runifmain = async (meta, fn) => {
|
import { errorreporter, summaryreporter } from '../index.js'
|
||||||
if (isMain(meta)) {
|
const runifmain = async (meta, fn, ...args) => {
|
||||||
await fn()
|
if (!isMain(meta)) return
|
||||||
}
|
|
||||||
|
if (args.length == 0) args.push(summaryreporter(), errorreporter())
|
||||||
|
await fn(...args)
|
||||||
}
|
}
|
||||||
|
|
||||||
export { runifmain }
|
export { runifmain }
|
||||||
|
|
Loading…
Reference in New Issue