metaltest/reporter/totalreporter.js

17 lines
457 B
JavaScript

import chalk from 'chalk'
const totalreporter = () => {
let success = 0, fail = 0, skip = 0
return {
success: (test) => { success++ },
fail: (test, e) => { fail++ },
skip: (test) => { skip++ },
msg: () => `${chalk.redBright(`Fail: ${fail}`)}
${chalk.greenBright(`Sucess: ${success}`)}
${chalk.blueBright(`Skip: ${skip}`)}
${chalk.yellowBright(`Ratio ${(success / (success + fail) * 100).toFixed(0)}%`)}`
}
}
export { totalreporter }