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
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
readonlyerror:unknown|undefined
Defined in: src/engine/stub/stub.ts:116
Present on stubOnError when the step threw.
mem
readonlymem: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
readonlyout:Out|undefined
Defined in: src/engine/stub/stub.ts:114
Present after resolve (stubAfter). Undefined for stubBefore.
ui
readonlyui: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.