Target class [livewire] does not exist.
I have installed the Pest Livewire plugin according to the documentation:
https://pestphp.com/docs/plugins#livewire
I set up a
I created the following simple test:
However, I receive the following error:
https://pestphp.com/docs/plugins#livewire
I set up a
TestCase
, configuring the default user and panel.I created the following simple test:
However, I receive the following error:
Plugins | Pest - The elegant PHP Testing Framework
In this section, we will discuss the official and community developed plugins that we endorse. Plugins primarily offer namespaced functions, console commands, custom expectations, and additional command-line options to augment the default Pest experience.
16 Replies
dd(app()->runningUnitTests());
what is the output?
what is the error?
dd(app()->runningUnitTests());
what is the output?
add the
dd
inside the test..My bad 🤣
Ok, return 'false'
what is the
APP_ENV
value from phpunit.xml
file?
But I have an env.testing variable set, pointing to a test database.
are you using docker?
Yes, i am
are you running the test inside the container?
Yes, I am

I recommend double checking your env because definitely
dd(app()->runningUnitTests());
should return true..
You could also try the same test in another Filament fresh installI think this will be better, thank you for your time. If I figure out the problem, I’ll come back here with the solution.
I discovered the problem. Actually, I had started the project using the PHPUnit package (since I was used to using it for API tests). However, after creating a new project from scratch and choosing Pest, I noticed that a file is created:
/tests/Pest.php
:
This way, everything worked correctly. Since my scenario involves multi-tenancy, I also needed to add the following setup in TestCase
:
Thanks for the help again!