Fix ansi escape codes in console table

This commit is contained in:
Ian Webster
2023-07-26 23:15:20 -07:00
parent 5aff43afcf
commit 497b6987a2

View File

@@ -24,11 +24,11 @@ export function generateTable(summary: EvaluateSummary, tableCellMaxLength = 250
text = text.slice(0, tableCellMaxLength) + '...';
}
if (pass) {
return chalk.green.bold('[PASS] ') + text;
return chalk.green('[PASS] ') + text;
} else if (!pass) {
// color everything red up until '---'
return (
chalk.red.bold('[FAIL] ') +
chalk.red('[FAIL] ') +
text
.split('---')
.map((c, idx) => (idx === 0 ? chalk.red.bold(c) : c))