metaltest/reporter/totalreporter.js

15 lines
378 B
JavaScript
Raw Normal View History

2022-11-08 22:29:58 -05:00
import chalk from 'chalk'
const totalreporter = () => {
2022-12-30 13:34:35 -05:00
let success = 0, fail = 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++ },
msg: () => `${chalk.redBright(`Fail: ${fail}`)}
${chalk.greenBright(`Sucess: ${success}`)}
${chalk.yellowBright(`Ratio ${(success / (success + fail) * 100).toFixed(0)}%`)}`
2022-11-08 22:29:58 -05:00
}
}
export { totalreporter }