fix: ensures --retry works with errored tests

This commit is contained in:
Nuno Maduro
2023-01-02 20:59:59 +00:00
parent 43a7df2cc1
commit 330b4f0171
7 changed files with 44 additions and 14 deletions

View File

@ -0,0 +1,23 @@
<?php
declare(strict_types=1);
namespace Pest\Subscribers;
use Pest\TestSuite;
use PHPUnit\Event\Test\Failed;
use PHPUnit\Event\Test\FailedSubscriber;
/**
* @internal
*/
final class EnsureFailedTestsAreRetryable implements FailedSubscriber
{
/**
* Runs the subscriber.
*/
public function notify(Failed $event): void
{
TestSuite::getInstance()->retryRepository->add($event->test()->id());
}
}