Fixtures

Fixtures are reusable datasets for development, testing, demos, and preview environments. They populate your application with realistic records so you can build against real states instead of empty tables.

Use fixtures when you need users, content, orders, bookings, memberships, notifications, or any other working data that helps exercise the application.

Fixtures are not part of the required structure of your app. They exist to simulate usage and accelerate development.

Typical uses include:

  • building UI against realistic data
  • testing permissions and ownership rules
  • verifying dashboards, filters, and counts
  • previewing templates with believable content
  • reproducing bugs with known datasets
  • running automated tests against stable scenarios

Fixtures often model relationships and workflow states, not just isolated rows. A useful fixture set might include active and archived records, users with different roles, empty states, overdue items, draft content, or translated content.

Good fixtures are deterministic, repeatable, and disposable. You should be able to load them whenever needed and replace them without affecting core application data.

Think of fixtures as working data for environments where speed, realism, and repeatability matter.

Fixtures are stored in data/fixtures directory. Fixtures are loaded automatically during testing with vela test. Fixtures load after seed data and can depend on seed data records.

Syntax

$ vela fixtures <subcommand>

The subcommand can be one of the following:

  • generate - Generate fixture data

  • load - Load fixtures into the database

  • clear - Clear loaded fixtures from the database

  • reset - Clear and reload fixtures

  • regen - Clear fixtures from the database, regenerate fixture files, and reload them