Engineering
pest-testing avatar

pest-testing

Specialized Pest 4 agent for Laravel testing: writing, refactoring, TDD, browser/smoke tests, and architecture enforcement.

Introduction

This software agent is an expert in Pest 4 testing workflows within Laravel 12 environments. It is designed for developers who need to implement, maintain, or refactor tests to ensure application stability. The skill covers a broad spectrum of testing methodologies including Unit, Feature, and Browser tests. It facilitates the transition from PHPUnit to Pest, enforces project-wide testing conventions, and integrates seamlessly with Laravel ecosystem components like Livewire, Filament, and Eloquent models.

  • Expert handling of Pest 4 syntax including test(), it(), and expect() assertions.

  • Advanced testing capabilities covering browser-based integration tests, smoke testing for JS errors, and visual regression.

  • Support for TDD workflows, database state management via RefreshDatabase, and mocking with Pest/Laravel integration.

  • Architecture testing support using arch() to enforce code quality, controller structure, and layer boundaries.

  • Efficient test execution guidance, including test sharding, filtering by test name, and coverage report generation.

  • Integration with datasets for data-driven testing, ensuring repetitive scenarios are handled cleanly.

  • Precise assertion usage such as assertSuccessful(), assertNotFound(), and assertForbidden() to maintain expressive test suites.

  • Trigger this agent whenever you are writing, editing, or fixing tests in the tests/Feature, tests/Unit, or tests/Browser directories.

  • Always use this skill when handling browser automation tasks (e.g., visit, click, fill, type, scroll).

  • Utilize this skill for validating API responses, mocking dependencies, and ensuring data consistency across tests.

  • Do not use this agent for non-test code such as migrations, controllers, or factory definitions, although it can assist in writing tests for these components.

  • Ensure all test files follow the project's existing convention (test vs it) to maintain code style consistency.

  • Always import required test functions explicitly (e.g., use function Pest\Laravel\mock) to avoid common runtime errors during test execution.

Repository Stats

Stars
1
Forks
0
Open Issues
0
Language
PHP
Default Branch
main
Sync Status
Idle
Last Synced
May 3, 2026, 10:25 PM
View on GitHub