metaltest/reporter/consolereporter.js

25 lines
437 B
JavaScript
Raw Normal View History

2022-11-08 22:29:58 -05:00
import chalk from 'chalk'
2022-12-04 23:40:07 -05:00
2022-11-08 22:29:58 -05:00
const log = (...args) => process.stdout.write(...args)
const consolereporter = () => {
const report = {
start: (title) => {
log(chalk.cyanBright(title) + ' ')
},
success: (test) => {
log(chalk.greenBright('✓ '))
},
fail: (test, e) => {
log(chalk.redBright('✗ '))
},
end: (stats) => {
2022-12-04 16:06:06 -05:00
log('\n')
2022-11-08 22:29:58 -05:00
}
}
return report
}
export { consolereporter }