pestphp/pest · error · TestDescriptionMissing

A test in [%s] is missing its description. Please give every

Error message

A test in [%s] is missing its description. Please give every test a description.

What it means

Error "A test in [%s] is missing its description. Please give every test a description." thrown in pestphp/pest.

Source

Thrown at src/PendingCalls/TestCall.php:67

    public function __construct(
        private readonly TestSuite $testSuite,
        private readonly string $filename,
        private ?string $description = null,
        ?Closure $closure = null
    ) {
        $this->testCaseMethod = new TestCaseMethodFactory($filename, $closure);

        $this->descriptionLess = $description === null;

        $this->describing = DescribeCall::describing();

        $this->testSuite->beforeEach->get($this->filename)[0]($this);
    }

    public function after(Closure $closure): self
    {
        if ($this->description === null) {
            throw new TestDescriptionMissing($this->filename);
        }

        $description = $this->describing === []
            ? $this->description
            : Str::describe($this->describing, $this->description);

        $filename = $this->filename;

        $when = function () use ($closure, $filename, $description): void {
            if ($this::$__filename !== $filename) { // @phpstan-ignore-line
                return;
            }

            if ($this->__description !== $description) { // @phpstan-ignore-line
                return;
            }

            if ($this->__ran !== true) { // @phpstan-ignore-line

View on GitHub (pinned to 1af74a215c)

When it happens

Trigger: Thrown at src/PendingCalls/TestCall.php:67 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of pestphp/pest@1af74a215c (2026-08-21). Data as JSON: /api/errors/417a35483315be65. Report an issue: GitHub.