metaltest/reporter/consolereporter.js

25 lines
437 B
JavaScript

import chalk from 'chalk'
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) => {
log('\n')
}
}
return report
}
export { consolereporter }