Generate Laravel tests with Pest following best practices
Generates Laravel Pest tests following best practices for feature, browser, and unit testing.
/plugin marketplace add horuz-ai/claude-plugins/plugin install horuz-ai-laravel-plugins-laravel@horuz-ai/claude-plugins[feature/controller/specific test description]Request: $ARGUMENTS
search_docs if unsure about current syntaxVague request (e.g., "test TaskController"): Propose a test plan first covering happy path, validation, authorization, edge cases, and business rules. Wait for confirmation.
Specific request (e.g., "test users cannot cancel after 24 hours"): Write the test directly.
it(), never test()expect() over PHPUnit assertionsit('prevents duplicate votes on the same proposal')it('works') or it('returns 200')describe() to group related testsbeforeEach() for shared setup within describe blocksexpect($user)->name->toBe('X')->email->toEndWith('@example.com')expect($users)->each->toBeInstanceOf(User::class)->not->toBeEmpty()->with([...]) for parameterized tests, use named datasets for claritybeforeEach(), afterEach() for setup/teardownactingAs() for authenticationassertInertia() for Inertia responses - verify component and propsassertDatabaseHas(), assertDatabaseCount(), assertModelExists()Event::fake() and Event::assertDispatched()Notification::fake() and Notification::assertSentTo()Queue::fake() and Queue::assertPushed()Mail::fake() and Mail::assertSent()pestphp/pest-plugin-browser + playwrightvisit('/path') returns page objectclick(), type(), fill(), press(), select(), check(), radio(), attach(), hover(), drag()->on()->mobile(), ->on()->iPhone14Pro()->firefox(), ->safari() or CLI --browser firefox->inDarkMode()assertNoSmoke(), assertNoJavaScriptErrors(), assertNoConsoleLogs(), assertNoAccessibilityIssues()assertScreenshotMatches()->tinker() for REPL, ->debug() to pause, ->screenshot()--headed for visible browser, --debug to pause on failure, --parallel for speedtests/Feature/ - HTTP and database tests, grouped by domain (Auth/, Tasks/, Api/)tests/Browser/ - Browser tests for critical JS-dependent flowstests/Unit/ - Pure logic teststests/Pest.php - Configuration, traits, custom helpersFor any feature, verify: