mirror of
https://github.com/pestphp/pest.git
synced 2026-03-09 17:27:22 +01:00
feat: improves feedback when test misses description
This commit is contained in:
@ -8,6 +8,7 @@ use ParseError;
|
||||
use Pest\Concerns;
|
||||
use Pest\Contracts\HasPrintableTestCaseName;
|
||||
use Pest\Exceptions\DatasetMissing;
|
||||
use Pest\Exceptions\TestDescriptionMissing;
|
||||
use Pest\Exceptions\ShouldNotHappen;
|
||||
use Pest\Exceptions\TestAlreadyExist;
|
||||
use Pest\Factories\Concerns\HigherOrderable;
|
||||
@ -224,7 +225,7 @@ final class TestCaseFactory
|
||||
public function addMethod(TestCaseMethodFactory $method): void
|
||||
{
|
||||
if ($method->description === null) {
|
||||
throw ShouldNotHappen::fromMessage('The test description may not be empty.');
|
||||
throw new TestDescriptionMissing($method->filename);
|
||||
}
|
||||
|
||||
if (array_key_exists($method->description, $this->methods)) {
|
||||
|
||||
Reference in New Issue
Block a user