abstractFactory <TEntity, TInput>
Index
Constructors
constructor
Parameters
Returns Factory<TEntity, TInput>
Properties
abstractreadonlymodel
Methods
create
Create (and flush) multiple entities
Parameters
amount: number
Number of entities that should be generated
optionalinput: TInput
Object specifying what default attributes of the entity factory should be overridden
Returns Promise<TEntity[]>
createOne
Create (and flush) a single entity
Parameters
optionalinput: TInput
Object specifying what default attributes of the entity factory should be overridden
Returns Promise<TEntity>
each
Set a function that is applied to each entity before it is returned In case of
createOneorcreateit is applied before the entity is persistedParameters
eachFunction: (entity, index) => void
The function that is applied on every entity
Returns this
make
Make multiple entities and then persist them (not flush)
Parameters
amount: number
Number of entities that should be generated
optionalinput: TInput
Object specifying what default attributes of the entity factory should be overridden
Returns TEntity[]
makeEntity
Make a single entity instance, without persisting it.
Parameters
optionalinput: TInput
Object specifying what default attributes of the entity factory should be overridden
index: number = 0
Returns TEntity
makeOne
Make a single entity and persist (not flush)
Parameters
optionalinput: TInput
Object specifying what default attributes of the entity factory should be overridden
Returns TEntity
Base class for entity factories used in seeding. Provides methods to create and persist test entities.