Skip to content

Commit

Permalink
UX update for list of failed tests (#87)
Browse files Browse the repository at this point in the history
The line "The following tests failed: " was appearing when there were
no test failures. This update simply updates it to only display when
there are failed tests.
  • Loading branch information
nicrowe00 authored May 13, 2024
1 parent cec2ad6 commit c91e1c4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Turkey/TestOutputFormat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public async override Task PrintFailedTests()
Console.WriteLine("The following tests failed: ");
foreach(var test in failedTests)
{
Console.WriteLine($"{string.Format("{0,-30}", test.Name)}({test.Duration})");
Console.WriteLine($"{string.Format("{0,-30}", test.Name)}({test.Duration})");
}
}

Expand Down
5 changes: 4 additions & 1 deletion Turkey/TestRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,10 @@ public async Task<TestResults> ScanAndRunAsync(List<TestOutput> outputs, string
await outputs.ForEachAsync(output => output.AfterRunningTestAsync(testName, testResult, testLog, testTimeWatch.Elapsed));
}

await outputs.ForEachAsync(outputs => outputs.PrintFailedTests());
if (results.Failed != 0 )
{
await outputs.ForEachAsync(outputs => outputs.PrintFailedTests());
}

await outputs.ForEachAsync(output => output.AfterRunningAllTestsAsync(results));

Expand Down

0 comments on commit c91e1c4

Please sign in to comment.