2022-11-08 22:29:58 -05:00
|
|
|
import chalk from 'chalk'
|
|
|
|
|
|
|
|
const totalreporter = () => {
|
2022-12-30 13:42:42 -05:00
|
|
|
let success = 0, fail = 0, skip = 0
|
2022-11-08 22:29:58 -05:00
|
|
|
|
|
|
|
return {
|
2022-12-30 13:34:35 -05:00
|
|
|
success: (test) => { success++ },
|
|
|
|
fail: (test, e) => { fail++ },
|
2022-12-30 13:42:42 -05:00
|
|
|
skip: (test) => { skip++ },
|
2022-12-30 13:34:35 -05:00
|
|
|
msg: () => `${chalk.redBright(`Fail: ${fail}`)}
|
|
|
|
${chalk.greenBright(`Sucess: ${success}`)}
|
2022-12-30 13:42:42 -05:00
|
|
|
${chalk.blueBright(`Skip: ${skip}`)}
|
2022-12-30 13:44:56 -05:00
|
|
|
${chalk.yellowBright(`Ratio: ${(success / (success + fail) * 100).toFixed(0)}%`)}`
|
2022-11-08 22:29:58 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export { totalreporter }
|