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:
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:
- Install Composer and pnpm dependencies
- Publish Core assets (Testbench setup)
- Generate TypeScript types
- TypeScript type check
- Build frontend assets
- 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.