diff --git a/crates/moon/src/cli/test.rs b/crates/moon/src/cli/test.rs index 51dacf9e..922dbb25 100644 --- a/crates/moon/src/cli/test.rs +++ b/crates/moon/src/cli/test.rs @@ -288,9 +288,21 @@ fn do_run_test( let failed = total - passed; println!( "Total tests: {}, passed: {}, failed: {}.", - total.to_string().blue(), - passed.to_string().green(), - failed.to_string().red() + if total > 0 { + total.to_string().blue().to_string() + } else { + total.to_string() + }, + if passed > 0 { + passed.to_string().green().to_string() + } else { + passed.to_string() + }, + if failed > 0 { + failed.to_string().red().to_string() + } else { + failed.to_string() + } ); if passed == total {