Skip to content

Commit

Permalink
Pass description into describe call
Browse files Browse the repository at this point in the history
  • Loading branch information
jshayes committed Jan 20, 2025
1 parent b5b8fab commit 50ff347
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 1,060 deletions.
3 changes: 2 additions & 1 deletion src/Functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
use Pest\Support\Backtrace;
use Pest\Support\Container;
use Pest\Support\DatasetInfo;
use Pest\Support\Description;
use Pest\Support\HigherOrderTapProxy;
use Pest\TestSuite;
use PHPUnit\Framework\TestCase;
Expand Down Expand Up @@ -95,7 +96,7 @@ function describe(string $description, Closure $tests): DescribeCall
{
$filename = Backtrace::testFile();

return new DescribeCall(TestSuite::getInstance(), $filename, $description, $tests);
return new DescribeCall(TestSuite::getInstance(), $filename, new Description($description), $tests);
}
}

Expand Down
9 changes: 2 additions & 7 deletions src/PendingCalls/DescribeCall.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,16 @@ final class DescribeCall
*/
private ?BeforeEachCall $currentBeforeEachCall = null;

/**
* The unique description for this describe block
*/
private readonly Description $description;

/**
* Creates a new Pending Call.
*/
public function __construct(
public readonly TestSuite $testSuite,
public readonly string $filename,
string $description,
public readonly Description $description,
public readonly Closure $tests
) {
$this->description = new Description($description);
//
}

/**
Expand Down
Loading

0 comments on commit 50ff347

Please sign in to comment.