Compare commits

..

3 Commits

Author SHA1 Message Date
4a987d3d5c release: 3.7.4 2025-01-23 14:03:29 +00:00
4079a08f5f feat: adds --compact to coverage 2025-01-23 13:59:51 +00:00
e4aab77a34 release: 3.7.3 2025-01-23 12:51:02 +00:00
6 changed files with 19 additions and 6 deletions

View File

@ -19,7 +19,7 @@
"require": {
"php": "^8.2.0",
"brianium/paratest": "^7.7.0",
"nunomaduro/collision": "^8.5.0",
"nunomaduro/collision": "^8.6.1",
"nunomaduro/termwind": "^2.3.0",
"pestphp/pest-plugin": "^3.0.0",
"pestphp/pest-plugin-arch": "^3.0.0",

View File

@ -6,7 +6,7 @@ namespace Pest;
function version(): string
{
return '3.7.2';
return '3.7.4';
}
function testDirectory(string $file = ''): string

View File

@ -37,6 +37,11 @@ final class Coverage implements AddsOutput, HandlesArguments
*/
public bool $coverage = false;
/**
* Whether it should show the coverage or not.
*/
public bool $compact = false;
/**
* The minimum coverage.
*/
@ -124,6 +129,10 @@ final class Coverage implements AddsOutput, HandlesArguments
$this->coverageExactly = (float) $exactlyOption;
}
if ($_SERVER['COLLISION_PRINTER_COMPACT'] ?? false) {
$this->compact = true;
}
return $originals;
}
@ -144,7 +153,7 @@ final class Coverage implements AddsOutput, HandlesArguments
exit(1);
}
$coverage = \Pest\Support\Coverage::report($this->output);
$coverage = \Pest\Support\Coverage::report($this->output, $this->compact);
$exitCode = (int) ($coverage < $this->coverageMin);
if ($exitCode === 0 && $this->coverageExactly !== null) {

View File

@ -74,7 +74,7 @@ final class Coverage
* Reports the code coverage report to the
* console and returns the result in float.
*/
public static function report(OutputInterface $output): float
public static function report(OutputInterface $output, bool $compact = false): float
{
if (! file_exists($reportPath = self::getPath())) {
if (self::usingXdebug()) {
@ -113,6 +113,10 @@ final class Coverage
? '100.0'
: number_format($file->percentageOfExecutedLines()->asFloat(), 1, '.', '');
if ($percentage === '100.0' && $compact) {
continue;
}
$uncoveredLines = '';
$percentageOfExecutedLinesAsString = $file->percentageOfExecutedLines()->asString();

View File

@ -1,5 +1,5 @@
Pest Testing Framework 3.7.2.
Pest Testing Framework 3.7.4.
USAGE: pest <file> [options]

View File

@ -1,3 +1,3 @@
Pest Testing Framework 3.7.2.
Pest Testing Framework 3.7.4.