JCC Express

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() and tearDown()
  • you use HTTP and database assertions to verify behavior

Core testing classes

  • TestCase - boots your app and exposes helper methods
  • MakesHttpRequests - request helpers: get, post, put, patch, delete
  • TestResponse - fluent response assertions
  • InteractsWithDatabase - database and model assertions

Supported test runners

This project can run tests with:

  • vitest (via npm run test)
  • Bun test (via bun test)

Use the runner that matches your workflow.


Test structure

Common layout in the app:

  • tests/Feature for endpoint and request flow tests
  • tests/Unit for isolated logic tests
  • tests/TestCase.ts for 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.