Metakit / @doeixd/metakit/temporal

AsyncScenario

interface · packages/metakit/src/temporalWalk.ts:335

interface AsyncScenario<World, Name extends string> {
  readonly initial: () => Promise<World>
  readonly steps: ReadonlyArray<AsyncStep<World, Name>>
  readonly holds: (
    world: World,
    ran: ReadonlyArray<Name>,
  ) => Promise<Option.Option<string>>
  readonly finish?: (world: World) => Promise<void>
}

Scenario for steps that must be awaited: each order runs on a world of its own.

Members

AsyncScenario.initial

property · packages/metakit/src/temporalWalk.ts:336

readonly initial: () => Promise<World>

AsyncScenario.steps

property · packages/metakit/src/temporalWalk.ts:337

readonly steps: ReadonlyArray<AsyncStep<World, Name>>

AsyncScenario.holds

property · packages/metakit/src/temporalWalk.ts:339

readonly holds: (
  world: World,
  ran: ReadonlyArray<Name>,
) => Promise<Option.Option<string>>

Asked after every step, with the steps run so far: a reason when the property is broken.

AsyncScenario.finish

property · packages/metakit/src/temporalWalk.ts:341

readonly finish?: (world: World) => Promise<void>

Closes the world an order ran on, whether or not it broke the property.