Testing Overview
JCC Express MVC provides a Laravel-style testing experience through the framework testing layer in jcc-express-mvc/lib/Testing.
At a high level:
- your project defines
tests/TestCase.ts - your test class extends the framework
TestCase - each test runs
setUp()andtearDown() - you use HTTP and database assertions to verify behavior
Core testing classes
TestCase- boots your app and exposes helper methodsMakesHttpRequests- request helpers:get,post,put,patch,deleteTestResponse- fluent response assertionsInteractsWithDatabase- database and model assertions
Supported test runners
This project can run tests with:
vitest(vianpm run test)- Bun test (via
bun test)
Use the runner that matches your workflow.
Test structure
Common layout in the app:
tests/Featurefor endpoint and request flow teststests/Unitfor isolated logic teststests/TestCase.tsfor app bootstrap in tests
Artisan test generation
The available generator is:
Bash
This command generates a feature test scaffold. There is no separate make:unit command in the current CLI.
