diff --git a/packages/discovery/src/BootDiscovery.php b/packages/discovery/src/BootDiscovery.php index 70991d530..de15cafca 100644 --- a/packages/discovery/src/BootDiscovery.php +++ b/packages/discovery/src/BootDiscovery.php @@ -8,6 +8,7 @@ use AssertionError; use Closure; use Pest\Exceptions\InvalidPestCommand; +use Pest\Exceptions\TestAlreadyExist; use Psr\Container\ContainerInterface; use Psr\Container\NotFoundExceptionInterface; use Tempest\Discovery\Exceptions\DiscoveryClassCouldNotBeResolved; @@ -208,7 +209,9 @@ private function discoverPath(string $input, DiscoveryLocation $location, array } elseif (class_exists($className)) { $input = new ClassReflector($className); } - } catch (AssertionError|InvalidPestCommand) { // @phpstan-ignore class.notFound + + // @phpstan-ignore-next-line + } catch (AssertionError|InvalidPestCommand|TestAlreadyExist) { // Workaround for Pest test files autoloading. // @mago-expect lint:no-empty-catch-clause }