Skip to main content

Test Setup

Core tests use Pest with Orchestra Testbench, which boots a minimal Laravel instance in isolation — no client project required. Tests live in tests/Feature/ and tests/Unit/.

Running Tests

Run only the tests relevant to your current change using --filter:
vendor/bin/pest --filter=CoreTableTest
Run the full suite before committing:
composer test
Always run the full suite before opening a PR or cutting a release. Targeted --filter runs are for iteration speed, not final verification.

Writing Tests

Follow Pest conventions. Tests should cover:
  • Happy path — the feature works as expected
  • Authorization — unauthorized users are rejected
  • Validation — invalid input returns the correct errors
  • Edge cases — boundary conditions and empty states
it('applies schema validation rules', function () {
    $rules = Order::schemaDefinition()->only(['status'])->rules();

    expect($rules)->toHaveKey('status');
    expect($rules['status'])->toContain('required');
});

CI Environment

The GitHub Actions workflow (.github/workflows/laravel.yml) runs on every push and pull request:
  1. Install Composer and pnpm dependencies
  2. Publish Core assets (Testbench setup)
  3. Generate TypeScript types
  4. TypeScript type check
  5. Build frontend assets
  6. Run the full Pest test suite
Ensure your changes pass CI before merging. The workflow also triggers a deployment to staging when tests pass on the active version branch.