// Generates 5 users in a 'verified' state with the password set as 'secret'.
// Each of these users will have 10 associated posts.
const users = await database
.factory(users)
.count(5)
.state('verified')
.has(database.factory(posts).count(10))
.set({
password: 'secret',
});
Describe what you want
A factory API that allows creating testing data easily.
Example API inspired by Laravel Eloquent Factories: