Sample of writing unit tests using Pest
Hello I'm new in Filament and I'm writing unit tests for my Resources
However whenever I create a unit test class outside Pest.php (tests/Feature/) the pest methods doesnt work unless if they're within the Pest.php
I tried searching on Google but no luck the documentation doesn't cover writing unit tests from scratch.
3 Replies
the pest methods doesnt workWhat error are you getting specifically?
@pboivin
I managed to run it properly, though I'm having a hard time testing create forms that has relationship on it
Hi ,Im trying to write test for creating resource in filament but i get : t vendor\livewire\livewire\src\Testing\TestableLivewire.php:181
177▕
178▕ public function pretendWereSendingAComponentUpdateRequest($message,
$payload)
179▕ {
180▕ $result = $this->callEndpoint('POST', '/livewire/message/'.$thi
s->componentName, [
➜ 181▕ 'fingerprint' => $this->payload['fingerprint'],
182▕ 'serverMemo' => $this->payload['serverMemo'],
183▕ 'updates' => [['type' => $message, 'payload' => $payload]],
184▕ ]);
185▕
1 vendor\livewire\livewire\src\Testing\Concerns\MakesCallsToComponent.php:14
3
2 vendor\livewire\livewire\src\Testing\Concerns\MakesCallsToComponent.php:88