Skip to content

Commit 2c32e9b

Browse files
Update README and ExecutionTimeReportPrinter for improved test output formatting
- Changed code block syntax in README to `text` for better readability. - Enhanced the display format of slowest tests in README to include a timer icon. - Adjusted spacing in the `ExecutionTimeReportPrinter` for consistent output formatting.
1 parent 54e176e commit 2c32e9b

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,12 @@ After running your tests, you'll see a summary report at the end showing the slo
5757
- **Red**: Tests that exceed the danger threshold (default: 5 seconds)
5858
- **Normal**: Tests below the warning threshold
5959

60-
```
60+
```text
6161
Top 10 slowest tests:
6262
63-
1. MyTest::testSlowOperation : 1234.56 ms (1.235 s) [colored red]
64-
2. AnotherTest::testComplexCalculation : 987.65 ms (0.988 s) [colored yellow]
65-
3. DatabaseTest::testLargeQuery : 654.32 ms (0.654 s) [colored yellow]
63+
1. ⏱ 1234.56 ms (1.235 s) MyTest::testSlowOperation [colored red]
64+
2. 987.65 ms (0.988 s) AnotherTest::testComplexCalculation [colored yellow]
65+
3. ⏱ 654.32 ms (0.654 s) DatabaseTest::testLargeQuery [colored yellow]
6666
...
6767
```
6868

src/ExecutionTimingExtension/ExecutionTimeReportPrinter.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ public function print(): void
4545

4646
$this->printHeader(count($topTests));
4747
$this->printTestLines($topTests);
48-
49-
echo PHP_EOL;
5048
}
5149

5250
private function shouldPrint(): bool
@@ -142,7 +140,7 @@ private function printTestLine(array $test, int $rank, array $columnWidths): voi
142140
$timeSecDisplay = $color !== '' ? Color::colorize($color, $timeSecFormatted) : $timeSecFormatted;
143141

144142
printf(
145-
" %s. ⏱ %s %s %s" . PHP_EOL,
143+
" %s. ⏱ %s %s %s" . PHP_EOL,
146144
$rankFormatted,
147145
$timeMsDisplay,
148146
$timeSecDisplay,

0 commit comments

Comments
 (0)