pest-testing

pest-testing is a skill for Claude Code, Codex from spatie/freek.dev. It costs 72 tokens per session (1,115 once invoked), scanned A, original, MIT.

A testing guide for PHP applications built with Pest 4, a framework for writing automated checks. It covers unit, feature, browser, architecture, and visual regression tests.

In plain words
What is it for?
Use it to create or update tests, add assertions, test Livewire components, run browser or smoke tests, use datasets and mocks, and check coverage.
Why use it?
It gives tests a consistent structure and helps investigate failures without guessing which Pest patterns or commands to use.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/spatie/freek.dev/pest-testing
Any agent
npx skills add spatie/freek.dev --skill pest-testing
Clone the repo
git clone --depth 1 https://github.com/spatie/freek.dev

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for pest-testing

README.md
[![agentmods](https://agentmods.dev/badge/skills/spatie/freek.dev/pest-testing.svg)](https://agentmods.dev/skills/spatie/freek.dev/pest-testing)
Your own site
<a href="https://agentmods.dev/skills/spatie/freek.dev/pest-testing"><img src="https://agentmods.dev/badge/skills/spatie/freek.dev/pest-testing.svg" alt="Measured on agentmods" height="20"></a>
Per session 72 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,115 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00072 $0.01115
Opus 5 $0.00036 $0.00558
Sonnet 5 $0.00014 $0.00223
Haiku 4.5 $0.00007 $0.00112

Measured 3d ago against content hash 2bc98aa6d38e, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

pest-testing scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/pest-testing/SKILL.md · 174 lines

How it starts

The opening of the file, as written. The whole thing — 174 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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.

Basic Usage

Creating Tests

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

Test Organization

  • Unit/Feature tests: tests/Feature and tests/Unit directories.
  • Browser tests: tests/Browser/ directory.
  • Do NOT remove tests without approval - these are core application code.

Basic Test Structure

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

Running Tests

  • Run minimal tests with filter before finalizing: php artisan test --compact --filter=testName.
  • Run all tests: php artisan test --compact.
  • Run file: php artisan test --compact tests/Feature/ExampleTest.php.

Assertions

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

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

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

Mocking

Import mock function before use: use function Pest\Laravel\mock;

Datasets

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

it('has emails', function (string $email) { expect($email)->not->toBeEmpty(); })->with([ 'james' => '[email protected]', 'taylor' => '[email protected]', ]);

Pest 4 Features

Feature Purpose
Browser Testing Full integration tests in real browsers
Smoke Testing Validate multiple pages quickly
Visual Regression Compare screenshots for visual changes
Test Sharding Parallel CI runs
Architecture Testing Enforce code conventions

Read the full file on GitHub · 174 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 174 lines · 72 tokens per session scan A 2bc98aa6d38e

Subscribe to this mod's changes

pest-testing is a skill published in the GitHub repository spatie/freek.dev (652 stars, last pushed 27d ago), licensed MIT. It adds 72 tokens to every session and 1,115 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

testing

Japa test patterns for an AdonisJS app. Functional specs hit real Postgres wrapped in per-test transactions; unit specs stub deps with sinon. Fakes are mandatory for anything that reaches out (mail, drive, emitter, transmit). Trigger on: "write test", "add spec", "cover with tests", "how do we test X", "mock", "fake"…

filipebraida/adonisjs-starter-kit · 82 tokens

laravel-testing

Laravel testing with PHPUnit and Dusk, feature tests, unit tests, browser tests, factories, assertions. ALWAYS activate when: writing tests, tests/Feature/, tests/Unit/, tests/Browser/, running php artisan test, test coverage, TDD. Triggers on: test failed, assertion error, factory, seeder, RefreshDatabase, actingAs…

anilcancakir/my-claude-code · 113 tokens

evaluate-pr-tests

Evaluates tests added in a PR for coverage, quality, edge cases, and test type appropriateness. Checks if tests cover the fix, finds gaps, and recommends lighter test types when possible. Prefer unit tests over device tests over UI tests. Triggers on: 'evaluate tests in PR', 'review test quality', 'are these tests…

dotnet/maui · 94 tokens

write-ui-tests

Creates UI tests for a GitHub issue and verifies they reproduce the bug. Iterates until tests actually fail (proving they catch the issue). Use when PR lacks tests or tests need to be created for an issue.

dotnet/maui · 48 tokens

run-helix-tests

Submit and monitor .NET MAUI unit tests on Helix infrastructure. Supports running XAML, Resizetizer, Core, Essentials, and other unit test projects on distributed Helix queues.

dotnet/maui · 45 tokens

js-in-html-testing

Test JS logic embedded in HTML using two-layer strategy - Python unit tests + Playwright browser integration tests.

liaohch3/claude-tap · 25 tokens