Skip to content

waygraph / StubCtx

Type Alias: StubCtx<Out> ​

StubCtx<Out> = object

Defined in: src/engine/stub/stub.ts:106

What a stub is given: chained where a flow uses a Block, it paints rings, todos, the device and the banner.

Example ​

ts
LoginBlock.stubBefore((ctx) => {
  ctx.ui.todos("sign-in", ["Enter email", "Enter password", "Click Sign in"], { index: 0 });
  ctx.ui.zoom(1.35);
  ctx.ui.ring("email", { selector: "#email", label: "Email" });
  ctx.ui.ring("submit", { selector: "#login-button", label: "Sign in" });
})
// Sequential plan: bump todoIndex in a later phase / a later Block's stubBefore
.stub((ctx) => {
  ctx.ui.todoIndex(2);
  ctx.ui.ring("inventory", { selector: ".inventory_list", label: "Landed" });
});

Type Parameters ​

Out ​

Out extends Checkpoint<string> = Checkpoint<string>

Properties ​

error ​

readonly error: unknown | undefined

Defined in: src/engine/stub/stub.ts:116

Present on stubOnError when the step threw.


mem ​

readonly mem: MemPage | undefined

Defined in: src/engine/stub/stub.ts:112

Live Mem for this run - same store act/observe read. Prefer this over closing over outer scope or inventing parallel fixture bags. Undefined only if the caller ran a stub phase without passing mem (tests).


out ​

readonly out: Out | undefined

Defined in: src/engine/stub/stub.ts:114

Present after resolve (stubAfter). Undefined for stubBefore.


ui ​

readonly ui: StubUi

Defined in: src/engine/stub/stub.ts:118

Everything a stub paints in the demo: rings, todos, title, caption, device, zoom, network tab, slides.

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