API Reference: Forger
The public entry point of the library.
Forger.create
Creates a fully populated fake of T.
Parameter | Type | Default | Description |
|---|---|---|---|
|
|
| Generation tuning — see SpoofSettings |
|
|
| Allowed nesting depth for circular types — see Circular references |
|
| — | Technical; never pass manually |
Returns the forged value. When the call reaches runtime without the transformer applied (bare tsc, an esbuild-based builder without the Vite plugin, jest without astTransformers), create throws the exported transformerNotAppliedMessage error instead of returning a value — see Caveats.
Forger.createWith
Creates a fake of T wrapped in a builder that allows pinning properties:
Parameters are identical to create — including throwing the transformerNotAppliedMessage error when the transformer did not run. The returned CreateWithModel exposes with() and result().
Default export
The class is available as both a named and a default export.