| 183 | const failedSteps = steps.filter(step => !step.passed).length |
| 184 | |
| 185 | function colorIfNonZero(n: number, color: Chalk, text: string): string { |
| 186 | return n > 0 ? color.bold(text) : chalk.bold(text) |
| 187 | } |
| 188 | |
| 189 | console.log(`\n${chalk.bold('Tests:')} ${colorIfNonZero(failedTests, chalk.redBright, failedTests + ' failed')}, ${colorIfNonZero(passedTests, chalk.greenBright, passedTests + ' passed')}, ${result.tests.length} total`) |
| 190 | console.log(`${chalk.bold('Steps:')} ${colorIfNonZero(failedSteps, chalk.redBright, failedSteps + ' failed')}, ${colorIfNonZero(skippedSteps, chalk.yellowBright, skippedSteps + ' skipped')}, ${colorIfNonZero(passedSteps, chalk.greenBright, passedSteps + ' passed')}, ${steps.length} total`) |