Compare commits

...

6 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
709ecb1ba2 chore: adjusts tests 2025-01-19 17:35:09 +00:00
6afb36519d release: 3.7.2 2025-01-19 17:16:25 +00:00
150bb9478d docs: adjusts sponsors 2025-01-08 01:09:20 +00:00
11 changed files with 40 additions and 20 deletions

View File

@ -22,23 +22,27 @@
We cannot thank our sponsors enough for their incredible support in funding Pest's development. Their contributions have been instrumental in making Pest the best it can be. For those who are interested in becoming a sponsor, please visit Nuno Maduro's Sponsor page at **[github.com/sponsors/nunomaduro](https://github.com/sponsors/nunomaduro)**.
### Platinum Sponsors
- **[CodeRabbit](https://coderabbit.ai)**
- **[LaraJobs](https://larajobs.com)**
- **[Brokerchooser](https://brokerchooser.com)**
- **[Forge](https://forge.laravel.com)**
- **[Laracasts](https://laracasts.com/?ref=pestphp)**
### Gold Sponsors
- **[CodeRabbit](https://coderabbit.ai/?ref=pestphp)**
- **[LaraJobs](https://larajobs.com/?ref=pestphp)**
- **[Brokerchooser](https://brokerchooser.com/?ref=pestphp)**
- **[Forge](https://forge.laravel.com/?ref=pestphp)**
### Premium Sponsors
- [Akaunting](https://akaunting.com/?ref=pestphp)
- [Codecourse](https://codecourse.com/?ref=pestphp)
- [DocuWriter.ai](https://www.docuwriter.ai/?ref=pestphp)
- [Laracasts](https://laracasts.com/?ref=pestphp)
- [Localazy](https://localazy.com/?ref=pestphp)
- [Route4Me](https://www.route4me.com/?ref=pestphp)
- [Spatie](https://spatie.be)
- [Worksome](https://www.worksome.com/)
- [Spatie](https://spatie.be/?ref=pestphp)
- [Worksome](https://www.worksome.com/?ref=pestphp)
- [Zapiet](https://www.zapiet.com/?ref=pestphp)
Pest is an open-sourced software licensed under the **[MIT license](https://opensource.org/licenses/MIT)**.

View File

@ -19,16 +19,16 @@
"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",
"pestphp/pest-plugin-mutate": "^3.0.5",
"phpunit/phpunit": "^11.5.1"
"phpunit/phpunit": "^11.5.3"
},
"conflict": {
"filp/whoops": "<2.16.0",
"phpunit/phpunit": ">11.5.1",
"phpunit/phpunit": ">11.5.3",
"sebastian/exporter": "<6.0.0",
"webmozart/assert": "<1.11.0"
},
@ -54,7 +54,7 @@
},
"require-dev": {
"pestphp/pest-dev-tools": "^3.3.0",
"pestphp/pest-plugin-type-coverage": "^3.2.0",
"pestphp/pest-plugin-type-coverage": "^3.2.3",
"symfony/process": "^7.2.0"
},
"minimum-stability": "dev",

View File

@ -25,7 +25,7 @@ final class BootOverrides implements Bootstrapper
'8abdad6413329c6fe0d7d44a8b9926e390af32c0b3123f3720bb9c5bbc6fbb7e' => 'TextUI/Output/Default/ProgressPrinter/Subscriber/TestSkippedSubscriber.php',
'b4250fc3ffad5954624cb5e682fd940b874e8d3422fa1ee298bd7225e1aa5fc2' => 'TextUI/TestSuiteFilterProcessor.php',
'8cfcb4999af79463eca51a42058e502ea4ddc776cba5677bf2f8eb6093e21a5c' => 'Event/Value/ThrowableBuilder.php',
'ede161507d4c9c27805f55a05a32c3bb528e53b6e1fc092bfafdb8207e0019e9' => 'Logging/JUnit/JunitXmlLogger.php',
'86cd9bcaa53cdd59c5b13e58f30064a015c549501e7629d93b96893d4dee1eb1' => 'Logging/JUnit/JunitXmlLogger.php',
];
/**

View File

@ -11,6 +11,7 @@ use Pest\Support\Str;
use PHPUnit\Event\Code\Test;
use PHPUnit\Event\Code\TestMethod;
use PHPUnit\Event\Code\Throwable;
use PHPUnit\Event\Test\AfterLastTestMethodErrored;
use PHPUnit\Event\Test\BeforeFirstTestMethodErrored;
use PHPUnit\Event\Test\ConsideredRisky;
use PHPUnit\Event\Test\Errored;
@ -254,8 +255,9 @@ final readonly class Converter
$numberOfNotPassedTests = count(
array_unique(
array_map(
function (BeforeFirstTestMethodErrored|Errored|Failed|Skipped|ConsideredRisky|MarkedIncomplete $event): string {
if ($event instanceof BeforeFirstTestMethodErrored) {
function (AfterLastTestMethodErrored|BeforeFirstTestMethodErrored|Errored|Failed|Skipped|ConsideredRisky|MarkedIncomplete $event): string {
if ($event instanceof BeforeFirstTestMethodErrored
|| $event instanceof AfterLastTestMethodErrored) {
return $event->testClassName();
}

View File

@ -6,7 +6,7 @@ namespace Pest;
function version(): string
{
return '3.7.1';
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

@ -30,6 +30,7 @@ final class StateGenerator
$testResultEvent->throwable()
));
} else {
// @phpstan-ignore-next-line
$state->add(TestResult::fromBeforeFirstTestMethodErrored($testResultEvent));
}
}

View File

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

View File

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