VOOZH about

URL: https://deepwiki.com/invokable/laravel-boost-copilot-cli/3.5-pest-testing-skill

⇱ Pest Testing Skill | invokable/laravel-boost-copilot-cli | DeepWiki


Loading...
Last indexed: 7 March 2026 (397730)
Menu

Pest Testing Skill

This document describes the pest-testing skill provided by the Laravel Boost Copilot CLI integration. The skill provides domain-specific guidelines and best practices for writing tests using Pest 4 PHP testing framework. For general information about MCP tools and skills, see 3.1. For details on how guidelines are synchronized and managed, see 5.3.

Overview

The pest-testing skill is a domain-specific skill that activates automatically when working with testing-related tasks in GitHub Copilot CLI. It provides comprehensive guidelines for writing, organizing, and debugging tests using Pest 4, including browser testing, architecture testing, and visual regression testing capabilities.

Key Characteristics:

PropertyValue
Skill Namepest-testing
FrameworkPest 4 PHP
LicenseMIT
Authorlaravel
File Location.github/skills/pest-testing/SKILL.md1-168
Referenced In.github/instructions/laravel-boost.instructions.md50

Sources: .github/skills/pest-testing/SKILL.md1-7 .github/instructions/laravel-boost.instructions.md48-51

Activation Mechanism

Activation Flow


Diagram: pest-testing Skill Activation Flow

Sources: .github/instructions/laravel-boost.instructions.md48-51 .github/skills/pest-testing/SKILL.md11-20

Activation Triggers

The skill activates when any of these conditions are met:

Trigger CategorySpecific Triggers
Test CreationWriting tests, creating unit tests, creating feature tests
Test TypesBrowser testing, architecture testing, visual regression tests
Test ActivitiesAdding assertions, debugging test failures, working with datasets, mocking
KeywordsUser mentions: test, spec, TDD, expects, assertion, coverage
VerificationUser needs to verify functionality works

Sources: .github/skills/pest-testing/SKILL.md11-20

Manual Activation

The guidelines explicitly instruct Copilot CLI to activate the skill proactively:

"You MUST activate the relevant skill whenever you work in that domain—don't wait until you're stuck."

"IMPORTANT: Activate pest-testing every time you're working with a Pest or testing-related task."

Sources: .github/instructions/laravel-boost.instructions.md48-50 .github/instructions/laravel-boost.instructions.md251

Skill File Structure

File Organization


Diagram: pest-testing Skill File Structure

Sources: .github/skills/pest-testing/SKILL.md1-168

Frontmatter Metadata

The skill file uses YAML frontmatter to define metadata:


This metadata allows the MCP server and Copilot CLI to identify and categorize the skill.

Sources: .github/skills/pest-testing/SKILL.md1-7

Testing Guidelines Provided

Test Creation

The skill provides specific guidance for creating tests:

CommandPurpose
php artisan make:test --pest {name}Create new Pest test
php artisan test --compactRun all tests
php artisan test --compact --filter=testNameRun specific test
php artisan test --compact tests/Feature/ExampleTest.phpRun test file

Directory Organization:

  • Unit/Feature tests: tests/Feature and tests/Unit
  • Browser tests: tests/Browser/

Critical Rule: Do NOT remove tests without approval - tests are core application code.

Sources: .github/skills/pest-testing/SKILL.md26-51

Assertion Best Practices

The skill enforces using specific assertion methods instead of generic ones:

Use ThisInstead OfReason
assertSuccessful()assertStatus(200)More semantic, clearer intent
assertNotFound()assertStatus(404)Explicit about expected outcome
assertForbidden()assertStatus(403)Better error messages

Example from skill documentation:


Sources: .github/skills/pest-testing/SKILL.md53-68

Datasets for Test Parameterization

The skill teaches using datasets to avoid repetitive test code:


Sources: .github/skills/pest-testing/SKILL.md74-86

Pest 4 Advanced Features

The skill documents all major Pest 4 features:

FeaturePurposeSection
Browser TestingFull integration tests in real browserslines 98-128
Smoke TestingValidate multiple pages quicklylines 131-140
Visual RegressionCompare screenshots for visual changeslines 142-143
Test ShardingParallel CI runslines 145-147
Architecture TestingEnforce code conventionslines 149-160

Sources: .github/skills/pest-testing/SKILL.md88-160

Browser Testing Example

The skill provides a comprehensive browser testing example showing Laravel integration:


Key capabilities demonstrated:

  • Laravel's Notification::fake() and Event::fake()
  • actingAs() for authentication
  • assertNoJavaScriptErrors() for catching JavaScript issues
  • Model factories with RefreshDatabase

Sources: .github/skills/pest-testing/SKILL.md98-128

Integration with Laravel Boost

Skill Loading Flow


Diagram: Skill Integration with MCP Server

Sources: .github/instructions/laravel-boost.instructions.md48-51 .github/skills/pest-testing/SKILL.md1-168

Documentation Tool Integration

The skill explicitly instructs Copilot CLI to use the search-docs MCP tool:

"Use search-docs for detailed Pest 4 patterns and documentation."

This ensures that when the skill is active, the AI can query version-specific Pest 4 documentation through the Laravel Boost MCP server.

Sources: .github/skills/pest-testing/SKILL.md22-24 .github/instructions/laravel-boost.instructions.md104-118

Common Pitfalls Prevention

The skill includes a dedicated section on common mistakes to avoid:

PitfallPrevention
Missing importMust use use function Pest\Laravel\mock; before using mock
Generic assertionsUse assertSuccessful() not assertStatus(200)
Repetitive testsUse datasets for validation tests instead of duplicating code
Deleting testsNever delete tests without approval
Missing JavaScript checksAlways include assertNoJavaScriptErrors() in browser tests

Sources: .github/skills/pest-testing/SKILL.md162-168

Environment-Specific Behavior

Package Development Context

When working in the package development environment (Orchestra Testbench), the guidelines include special instructions:


This affects how the pest-testing skill guides test creation in this specific environment.

Sources: .github/instructions/laravel-boost.instructions.md15-25

Test Creation Commands

EnvironmentCommand Format
Standard Laravel Appphp artisan make:test --pest {name}
Orchestra Testbenchvendor/bin/testbench make:test --pest {name}

Sources: .github/skills/pest-testing/SKILL.md29 .github/instructions/laravel-boost.instructions.md24

Relationship to Core Guidelines

Guideline Hierarchy


Diagram: pest-testing Skill in Guidelines Hierarchy

The pest-testing skill works in conjunction with the core Pest rules in the main guidelines:

  • Core rules (lines 243-252): Basic Pest commands and critical reminders
  • Skill file: Comprehensive Pest 4 feature documentation and best practices

Sources: .github/instructions/laravel-boost.instructions.md243-252 .github/skills/pest-testing/SKILL.md1-168

Usage Examples

When Skill Activates Automatically

The skill will activate in these scenarios:

  1. Creating a new test:

    User: "Create a test for the UserController index method"
    → Skill activates → Suggests using php artisan make:test --pest
    
  2. Debugging test failure:

    User: "This test is failing with a 500 error"
    → Skill activates → Suggests checking assertions, using assertSuccessful()
    
  3. Working with datasets:

    User: "I need to test validation for multiple invalid emails"
    → Skill activates → Suggests using datasets with ->with()
    

Sources: .github/skills/pest-testing/SKILL.md11-20

Skill-Guided Test Creation

When the skill is active, Copilot CLI will:

  1. Suggest php artisan make:test --pest {name} instead of generic test creation
  2. Recommend specific assertions (assertSuccessful() vs assertStatus(200))
  3. Propose datasets for repetitive test cases
  4. Include assertNoJavaScriptErrors() in browser tests
  5. Reference the search-docs tool for version-specific Pest documentation

Sources: .github/skills/pest-testing/SKILL.md26-168

Synchronization with Guidelines

The skill file is stored alongside other guidelines and instructions in the .github/ directory structure. When guidelines are synchronized (see 5.3), the skill file is included as part of the complete guideline system delivered to Copilot CLI.

File Structure:

.github/
├── instructions/
│ └── laravel-boost.instructions.md (references pest-testing skill)
└── skills/
 └── pest-testing/
 └── SKILL.md (detailed skill content)

Sources: .github/instructions/laravel-boost.instructions.md50 .github/skills/pest-testing/SKILL.md1-7