Skip to content

waygraph / GivenBlockOptions

Interface: GivenBlockOptions ​

Defined in: src/engine/block/kinds/given.ts:9

Properties ​

description? ​

optional description?: string

Defined in: src/engine/block/kinds/given.ts:12

What must be true before the scenario starts, in the scenario's words: "a tenant exists with two projects".


name ​

name: string

Defined in: src/engine/block/kinds/given.ts:10


ready? ​

optional ready?: (mem) => boolean | Promise<boolean>

Defined in: src/engine/block/kinds/given.ts:20

True when it is already there: run is skipped (and so is undo, it isn't this run's to remove).

Parameters ​

mem ​

MemPage

Returns ​

boolean | Promise<boolean>


run ​

run: (mem) => void | Promise<void>

Defined in: src/engine/block/kinds/given.ts:16

Makes it, with any code. Keep what the steps need (an id, a name) in mem.

Parameters ​

mem ​

MemPage

Returns ​

void | Promise<void>


sets? ​

optional sets?: readonly MemKey<unknown>[]

Defined in: src/engine/block/kinds/given.ts:14

The mem keys run fills: the flow's steps may read them without the run supplying them.


undo? ​

optional undo?: (mem) => void | Promise<void>

Defined in: src/engine/block/kinds/given.ts:18

Puts the world back; played after the flow, pass or fail, last given first. Its failure is reported, never the flow's.

Parameters ​

mem ​

MemPage

Returns ​

void | Promise<void>

waygraph 0.18.3 (alpha) · Node 24+ · peer @playwright/test ^1.40.0 · syntax may change before 1.0: see what was removed