smithery/neversight

pest

Pest framework syntax reference

Installation

$ npx skills add smithery/neversight --skill pest

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from smithery/neversight · top by installs.

npx skills add smithery/neversight

Browse all from smithery/neversight

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 1,824 B
  • docs SUMMARY.md 43 B

History

  1. First recorded snapshot · 0 installs

SKILL.md

Pest

Instructions

  • Use php artisan make:test --pest {name}.
  • Pest tests look and behave like this:

<code-snippet name="Basic Pest Test Example" lang="php"> it('is true', function () { expect(true)->toBeTrue(); }); </code-snippet>

Examples

Pest Assertions

  • When asserting status codes on a response, use the specific method like assertForbidden and assertNotFound instead of using assertStatus(403) or similar, e.g.:

<code-snippet name="Pest Example Asserting postJson Response" lang="php"> it('returns all', function () { $response = $this->postJson('/api/docs', []); $response->assertSuccessful(); }); </code-snippet>

Mocking

  • Mocking can be very helpful when appropriate.
  • When mocking, you can use the Pest\Laravel\mock Pest function, but always import it via use function Pest\Laravel\mock; before using it. Alternatively, you can use $this->mock() if existing tests do.
  • You can also create partial mocks using the same import or self method.

Datasets

  • Use datasets in Pest to simplify tests which have a lot of duplicated data. This is often the case when testing validation rules, so consider going with this solution when writing tests for validation rules.

<code-snippet name="Pest Dataset Example" lang="php"> it('has emails', function (string $email) { expect($email)->not->toBeEmpty(); })->with([ 'james' => '[email protected]', 'taylor' => '[email protected]', ]); </code-snippet>

Pest 4

  • Pest v4 is a huge upgrade to Pest and offers: browser testing, smoke testing, visual regression testing, test sharding, and faster type coverage.
  • Browser testing is incredibly powerful and useful for this project.
  • Browser tests should live in tests/Browser/.