feat(describe): continues work around hooks

This commit is contained in:
Nuno Maduro
2023-05-26 19:29:46 +01:00
parent 465c65243d
commit 3e8616ec64
11 changed files with 132 additions and 172 deletions

View File

@ -10,7 +10,6 @@ use Pest\Factories\Covers\CoversClass;
use Pest\Factories\Covers\CoversFunction;
use Pest\Factories\Covers\CoversNothing;
use Pest\Factories\TestCaseMethodFactory;
use Pest\PendingCalls;
use Pest\PendingCalls\Concerns\Describable;
use Pest\Plugins\Only;
use Pest\Support\Backtrace;
@ -52,6 +51,8 @@ final class TestCall
$this->descriptionLess = $description === null;
$this->describing = DescribeCall::describing();
$this->testSuite->beforeEach->get($this->filename)[0]($this);
}
@ -344,10 +345,11 @@ final class TestCall
*/
public function __destruct()
{
PendingCalls::test($this, function () {
if ($this->describing) {
$this->testCaseMethod->description = '`'.$this->describing.'` '.$this->testCaseMethod->description;
$this->testCaseMethod->describing = $this->describing;
}
$this->testSuite->tests->set($this->testCaseMethod);
});
$this->testSuite->tests->set($this->testCaseMethod);
}
}