Back to list
iurygdeoliveira

generate-tests

by iurygdeoliveira

Repositorio destinado a fornecer um kit inicial para desenvolvimento de SaaS usando laravel e filament

29🍴 12📅 Jan 20, 2026

SKILL.md


name: generate-tests description: Generates high-quality automated tests using Pest v4, including Unit, Feature, and Browser tests.

Pest Test Generator Skill

Use this skill to create reliable automated tests. It enforces the use of Pest v4 syntax and Browser Tests for E2E scenarios.

When to use this skill

  • When creating any new feature ("Create a test for X").
  • When needing to verify a bug fix.
  • When doing "Visual Regression" (via Browser Testing).
  • serena_find_file: To find existing tests for similar features (e.g., "Find tests for UsersTable").
  • laravel_boost_run_test: To run the specific test file created immediately after generation.

Workflow

1. Decision: Type of Test

  • Unit: Pure logic, no database (e.g., Service class logic). make:test --unit --pest
  • Feature: HTTP requests, Database side-effects, API, Livewire. make:test --pest
  • Browser: Full Javascript execution, complex interactions (Drag & drop, Modal flows). make:test --browser --pest

2. Implementation Rules

A. Syntax (Pest v4)

  • Functions: Use it('does something', function () { ... }).
  • Expectations: expect($value)->toBeTrue(). Avoid PHPUnit's $this->assertTrue().

B. Feature Tests (API / Livewire)

  • Livewire: Use Livewire::test(Component::class).
    • -> assertSet('prop', 'val')
    • -> call('method')
    • -> assertSee('Text')
  • HTTP: getJson(), postJson().
    • Use specific assertions: assertUnprocessable(), assertForbidden().

C. Browser Tests (Pest v4)

  • Syntax: Use the fluent visit() helper.
    it('can login', function () {
        visit('/login')
            ->type('email', 'admin@example.com')
            ->click('Login')
            ->assertPathIs('/admin');
    });
    

3. Architecture Testing

  • Use arch() to enforce code standards.
    arch()->preset()->php();
    arch()->preset()->laravel();
    arch()->expect('App\Models')->toBeStrictTypes();
    

3. Naming Conventions

  • Files: [Feature]Test.php (e.g., UserRegistrationTest.php).
  • Descriptions: "it [behavior] [context]" -> "it validates email format on registration".

4. Datasets

Use datasets for repetition reduction:

it('validates email', function ($email) {
    // ...
})->with(['invalid', 'no-at-sign.com']);

Score

Total Score

80/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

+10
人気

GitHub Stars 100以上

0/15
最近の活動

1ヶ月以内に更新

+10
フォーク

10回以上フォークされている

+5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

+5

Reviews

💬

Reviews coming soon