rok-orm-factory
Model factories for generating test data. Define factories for your rok models and use them in tests or seeders with realistic fake data.
Installation
[]
= { = "0.1" }
Quick Start
use ;
;
// In tests
async
Faker Helpers
email // "user_142@example.com"
name // "Alice Johnson"
uuid // UUID v4 string
word // random word
sentence // random sentence
paragraph // random paragraph
number // random number in range
bool // true or false
url // "https://example.com/path"
phone // "+1-555-0142"
With Overrides
let admin = UserFactory.with.create.await?;
Relationships
let post = PostFactory.for_user.create.await?;
// sets post.user_id = user.id