switchyard
    Preparing search index...

    Interface ModelTestOptions<M, H>

    Options for modelTests: the model, and how to drive and check the UI through a harness.

    interface ModelTestOptions<M extends Machine<unknown>, H> {
        events: Record<string, (harness: H, ...args: unknown[]) => unknown>;
        machine: () => M;
        paths?: "shortest" | "simple";
        states: Record<string, (harness: H) => unknown>;
    }

    Type Parameters

    Index
    events: Record<string, (harness: H, ...args: unknown[]) => unknown>

    How the user makes each event happen, through the harness.

    machine: () => M

    A fresh model machine.

    paths?: "shortest" | "simple"

    shortest (default): one path per state. simple: every path that revisits nothing.

    states: Record<string, (harness: H) => unknown>

    What the UI must show in each state, keyed by its active leaf paths (space-separated).