Skip to content
Agentmart
Submit a tool

pest-testing-conventions

Pest 4 testing conventions, workflows, and troubleshooting for Laravel projects.

Skill by ceilidhboy

IndexedMIT
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/ceilidhboy-pest-testing-conventions

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Pest 4 testing conventions, workflows, and troubleshooting for Laravel projects. Activates when writing or debugging tests, working with browser/smoke/architecture tests, handling test output issues (PAO mode, crash diagnostics), setting up datasets or mocking, and following project conventions for assertions, higher-order expectations, and test organization.

Use cases: testing, writing

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/pest-testing-conventions

What's inside

Skill name
pest-testing-conventions
Description
Pest 4 testing conventions, workflows, and troubleshooting for Laravel projects. Activates when writing or debugging tests, working with browser/smoke/architecture tests, handling test output issues (PAO mode, crash diagnostics), setting up datasets or mocking, and following project conventions for assertions, higher-order expectations, and test organization.
License
MIT
Instructions
106 lines in SKILL.md · view on GitHub

Files (6)

  • SKILL.md
  • assertions.md · references/
  • common-pitfalls.md · references/
  • deep-testing.md · references/
  • features.md · references/
  • test-organization.md · references/

SKILL.md (first lines)

# Pest Testing 4

## When to Apply

Activate this skill when:

- Creating new tests (unit, feature, or browser)
- Modifying existing tests
- Debugging test failures
- Working with browser testing or smoke testing
- Writing architecture tests or visual regression tests

## Documentation

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

### Creating Tests

All tests must be written using Pest. Use `php artisan make:test --pest {name}`.

### Basic Test Structure

```php
it('is true', function () {
    expect(true)
        ->toBeTrue();
});
```

The expect is on its own line with the actual expectations chained underneath.

### Running Tests

**Full test runs:** `php artisan test --parallel` (distributes across processes for speed)

**Quick iteration:** `php artisan test --compact --filter=testName`

Use `--parallel` for final verification before committing. Don't use `--parallel` for single files—it adds overhead with no benefit since tests in one file run in series.

**PAO output mode (Laravel 12+):** By default, test output is captured and shown as a compact JSON summary. If tests crash with no output or exit code 2, use `PAO_DISABLE=1 php artisan test ...` to get the raw PHP/Pest output and see the actual fatal error.

**Crashes without summary:** If the test run scrolls through green ticks then stops abruptly with no final summary and a non-zero exit code, a PHP fatal error likely killed the process mid-suite. This typically means a class definition error (e.g. extending a final class, interface method mismatch). Run `PAO_DISABLE=1 php -d display_errors=stderr vendor/bin/pest --filter=... 2>&1` on the affected test file to surface the actual fatal.

### TIA (Test Impact Analysis)

TIA runs only tests affected by your changes. Configured in `tests/Pest.php` with `pest()->tia()->directory('tests/.pest-tia-cache')->defaultBranch('master')->locally()`. The graph is committed to Git on master so worktrees and fresh clones get fast first runs.

- **Master worktree**: Changes visible in `git status`. To update the baseline: run `update-tia-baseline` (or `update-tia-baseline --push` to push immediately).
- **Non-master worktrees**: `--skip-worktree` is applied automatically by `setup-worktree`, hiding TIA changes from `git status`.

Script: `update-tia-baseline` (in `tool-scripts/worktree-setup/`).

## Assertions

> See [references/assertions.md](references/assertions.md) for **essential** guidance on assertion chaining patterns.

Use specific assertions (`assertSuccessful()`, `assertNotFound()`) instead of `assertStatus()`:

```php
it('returns all', function () {
    $this->postJson('/api/docs', [])->assertSuccessful();
});
```

| Use                  | Instead of          |
| -------------------- | ------------------- |
| `assertSuccessful()` | `assertStatus(200)` |
| `assertNotFound()`   | `assertStatus(404)` |
| `assertForbidden()`  | `assertStatus(403)` |

### Higher-Order Expectations

When asserting multiple properties on an object, set the subject to the root object and use higher-order expectations:

```php
it('user has correct data', function () {
    $user = User::factory()->create(['name' => 'John', 'email' => 'john@example.com']);

    expect($user)
        ->name->toBe('John')
        ->email->toBe('john@example.com');
});
```

## Datasets

Use datasets for repetitive tests (validation rules, etc.):

```php
it('has emails', function (string $email) {
    expect($email)->not->toBeEmpty();
})->with([
    'james' => 'james@laravel.com',
    'taylor' => 'taylor@laravel.com',
]);
```

## Reference Files

- [Test Organization](references/test-organization.md) - Directory structure, feature vs unit tests
- [Assertions](references/assertions.md) - Chaining patterns and best practices
- [Deep Testing](references/deep-testing.md) - Testing with real dependencies, when to mock
- [Features](references/features.md) - Browser testing, smoke testing, architecture testing
- [Common Pitfalls](references/common-pitfalls.md) - What to avoid

From ceilidhboy/skills, MIT.

More from ceilidhboy/skills

Signals

Stars
0
Forks
0
Open issues
0
Last commit (this folder)
Sep 2, 2026 (1 month ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from ceilidhboy

Cite this page

pest-testing-conventions skill. Agent Mart. https://agentmart.dev/skills/ceilidhboy-pest-testing-conventions (last updated 2026-10-24)