Skip to main content

generate

@webda/mock


Function: generate()

generate<T>(ModelClass, options?): Promise<T[]>

Defined in: engine/generate.ts:42

Generate count instances of ModelClass, resolving each field through the fallback chain (explicit @Mock.* → name-heuristic → type fallback → throw/skip).

Type Parameters​

T​

T

Parameters​

ModelClass​

ModelClass<T>

the target model constructor.

options?​

GenerateOptions<T> = {}

generation options (count, seed, mode, overrides, ai, pool, strict).

Returns​

Promise<T[]>

the generated instances.