Skip to main content

Scenarios

Scenarios are coordinated artifact and runtime flows. They are heavier than single-model tests and should be used when you need end-to-end proof.

What scenarios cover

  • coordinated model generation
  • services and controllers generated together
  • migration generation
  • factory generation
  • seeders
  • demo flows

Typical commands

eloquent make:scenario blog --test --controllers --services --run --force
eloquent demo:scenario --test --random
eloquent make:scenario --test --mongo --run

When to use scenario tests

  • generated artifact sets changed together
  • relations or preset flows changed
  • SQL and Mongo parity must be validated
  • demo output and scenario seed paths changed

Scenario test layers

  • generator integration tests
  • scenario lifecycle integration tests
  • runtime scenario persistence tests
  • generated REST API matrix tests over SQL drivers
  • demo and factory-status validation
  • tarball smoke for real-package behavior

Real REST API matrix

For a real-time validation pass, generate the blog scenario with controllers and services, then bind the generated controllers into an Express app and exercise HTTP CRUD. Execution order:
  1. PostgreSQL
  2. MySQL
  3. SQLite
Typical flow:
eloquent make:scenario blog --test --controllers --services --force
eloquent make:migration --all --test
eloquent migrate:run --test
eloquent db:seed --test --class BlogScenarioSeeder
REST routes exercised in the SQL matrix:
  • GET /users
  • POST /users
  • GET /users/:id
  • PUT /users/:id
  • GET /posts
  • POST /posts
  • GET /posts/:id
  • PUT /posts/:id
  • DELETE /posts/:id