mirror of
https://github.com/pestphp/pest.git
synced 2026-03-09 09:17:23 +01:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4a987d3d5c | |||
| 4079a08f5f |
@ -19,7 +19,7 @@
|
|||||||
"require": {
|
"require": {
|
||||||
"php": "^8.2.0",
|
"php": "^8.2.0",
|
||||||
"brianium/paratest": "^7.7.0",
|
"brianium/paratest": "^7.7.0",
|
||||||
"nunomaduro/collision": "^8.6.0",
|
"nunomaduro/collision": "^8.6.1",
|
||||||
"nunomaduro/termwind": "^2.3.0",
|
"nunomaduro/termwind": "^2.3.0",
|
||||||
"pestphp/pest-plugin": "^3.0.0",
|
"pestphp/pest-plugin": "^3.0.0",
|
||||||
"pestphp/pest-plugin-arch": "^3.0.0",
|
"pestphp/pest-plugin-arch": "^3.0.0",
|
||||||
|
|||||||
@ -6,7 +6,7 @@ namespace Pest;
|
|||||||
|
|
||||||
function version(): string
|
function version(): string
|
||||||
{
|
{
|
||||||
return '3.7.3';
|
return '3.7.4';
|
||||||
}
|
}
|
||||||
|
|
||||||
function testDirectory(string $file = ''): string
|
function testDirectory(string $file = ''): string
|
||||||
|
|||||||
@ -37,6 +37,11 @@ final class Coverage implements AddsOutput, HandlesArguments
|
|||||||
*/
|
*/
|
||||||
public bool $coverage = false;
|
public bool $coverage = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether it should show the coverage or not.
|
||||||
|
*/
|
||||||
|
public bool $compact = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The minimum coverage.
|
* The minimum coverage.
|
||||||
*/
|
*/
|
||||||
@ -124,6 +129,10 @@ final class Coverage implements AddsOutput, HandlesArguments
|
|||||||
$this->coverageExactly = (float) $exactlyOption;
|
$this->coverageExactly = (float) $exactlyOption;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($_SERVER['COLLISION_PRINTER_COMPACT'] ?? false) {
|
||||||
|
$this->compact = true;
|
||||||
|
}
|
||||||
|
|
||||||
return $originals;
|
return $originals;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -144,7 +153,7 @@ final class Coverage implements AddsOutput, HandlesArguments
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
$coverage = \Pest\Support\Coverage::report($this->output);
|
$coverage = \Pest\Support\Coverage::report($this->output, $this->compact);
|
||||||
$exitCode = (int) ($coverage < $this->coverageMin);
|
$exitCode = (int) ($coverage < $this->coverageMin);
|
||||||
|
|
||||||
if ($exitCode === 0 && $this->coverageExactly !== null) {
|
if ($exitCode === 0 && $this->coverageExactly !== null) {
|
||||||
|
|||||||
@ -74,7 +74,7 @@ final class Coverage
|
|||||||
* Reports the code coverage report to the
|
* Reports the code coverage report to the
|
||||||
* console and returns the result in float.
|
* 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 (! file_exists($reportPath = self::getPath())) {
|
||||||
if (self::usingXdebug()) {
|
if (self::usingXdebug()) {
|
||||||
@ -113,6 +113,10 @@ final class Coverage
|
|||||||
? '100.0'
|
? '100.0'
|
||||||
: number_format($file->percentageOfExecutedLines()->asFloat(), 1, '.', '');
|
: number_format($file->percentageOfExecutedLines()->asFloat(), 1, '.', '');
|
||||||
|
|
||||||
|
if ($percentage === '100.0' && $compact) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
$uncoveredLines = '';
|
$uncoveredLines = '';
|
||||||
|
|
||||||
$percentageOfExecutedLinesAsString = $file->percentageOfExecutedLines()->asString();
|
$percentageOfExecutedLinesAsString = $file->percentageOfExecutedLines()->asString();
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
Pest Testing Framework 3.7.3.
|
Pest Testing Framework 3.7.4.
|
||||||
|
|
||||||
USAGE: pest <file> [options]
|
USAGE: pest <file> [options]
|
||||||
|
|
||||||
|
|||||||
@ -1,3 +1,3 @@
|
|||||||
|
|
||||||
Pest Testing Framework 3.7.3.
|
Pest Testing Framework 3.7.4.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user