defineFixtures
Resolve a section's fixture module: its base scenario plus each named state.
Resolve a section’s fixture module: its base scenario plus each named state.
build receives the scenario constructor already bound to schema, which
is what types every authored slot map, .override() and state without an
annotation, plus bakedRows for the states that need a whole-row-baked
slot’s rows in hand. Each state resolves independently — nothing merges onto
base.
A slot a fill decision produces takes its authored or overridden value: every
remaining decision kind is generative, so none of them resolves to a fixture
value the way a direct or compute() binding does.
Import from @homepages/template-kit/fixtures.
Signature
Section titled “Signature”function defineFixtures<S>(schema: S, build: (scenario: ScenarioFactory<S>, bakedRows: BakedRowsFactory<S>) => FixtureModuleSpec<NoInfer<S>>): ResolvedFixtureModuleParameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
schema |
S |
required | |
build |
`( |
scenario: ScenarioFactory<S>,bakedRows: BakedRowsFactory<S>,) => FixtureModuleSpec<NoInfer>` | required | |
Returns
Section titled “Returns”ResolvedFixtureModule
Example
Section titled “Example”const fx = defineFixtures(schema, (scenario) => ({ base: scenario("luxuryMultiUnit", { blurb: "hello" }).at("multi"),}));fx.base.slots.blurb; // "hello"