fix: panic with TestDescriptionMissing

This commit is contained in:
Nuno Maduro
2024-08-19 02:24:18 +01:00
parent 6638d279e1
commit 4d9ed8768c

View File

@ -5,6 +5,7 @@ declare(strict_types=1);
namespace Pest;
use NunoMaduro\Collision\Writer;
use Pest\Exceptions\TestDescriptionMissing;
use Pest\Support\Container;
use Symfony\Component\Console\Output\ConsoleOutput;
use Symfony\Component\Console\Output\OutputInterface;
@ -27,6 +28,10 @@ final class Panic
*/
public static function with(Throwable $throwable): never
{
if ($throwable instanceof TestDescriptionMissing && ! is_null($previous = $throwable->getPrevious())) {
$throwable = $previous;
}
$panic = new self($throwable);
$panic->handle();