diff --git a/src/Configuration.php b/src/Configuration.php index fb4f45a4..4261f3ef 100644 --- a/src/Configuration.php +++ b/src/Configuration.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Pest; +use Pest\PendingCalls\BeforeEachCall; use Pest\PendingCalls\UsesCall; /** @@ -62,6 +63,14 @@ final readonly class Configuration return (new UsesCall($this->filename, []))->group(...$groups); } + /** + * Marks all tests in the current file to be run exclusively. + */ + public function only(): void + { + (new BeforeEachCall(TestSuite::getInstance(), $this->filename))->only(); + } + /** * Depending on where is called, it will extend the given classes and traits globally or locally. */