Skip to content

🏭 Framework-agnostic model factory system for clean testing

License

Notifications You must be signed in to change notification settings

Julien-R44/factorify

Repository files navigation

@julr/factorify

Framework-agnostic model factory system for clean testing.

Built-on top of Knex + Faker, and heavily inspired by Adonis.js and Laravel.

Have you ever written tests, in which the first 15-20 lines of each test are dedicated to just setting up the database state by using multiple models? With Factorify, you can extract all this set up to a dedicated file and then write the bare minimum code to set up the database state.

Features

  • Support for multiple databases ( SQLite, Postgres, MySQL, MSSQL ... )
  • Integrations with test runners
  • Define variations of your model using states
  • Define relations
  • Generate in-memory instances

Getting Started

Please follow the documentation at factorify.julr.dev !