mwg API
    Preparing search index...

    Type Alias SceneStep

    SceneStep: () => void | Promise<void>

    A scene control API for tests (roadmap 408): named steps a game opts into, driven by name.

    A game's own scene flow - enter a scenario, finish a turn, advance a dialogue - is private to the game, and that is the point of this seam: instead of the framework reaching into a game, the game registers the steps it wants a test or a headless Chrome to be able to drive, by name, on a SceneControls. The game decides what a step does; the controls only promise that a registered name runs its step and an unknown name is refused by name.

    Kept off the root barrel with the rest of src/testing: nothing here reaches a shipped game unless a test imports it.

    Type Declaration

      • (): void | Promise<void>
      • Returns void | Promise<void>

    import { createSceneControls } from '@datamoc/mwg/testing';

    const controls = createSceneControls();
    const enterScenario = (name: string) => {}; // the game's own private scene flow
    controls.register('enterScenario', () => enterScenario('the-freelands'));
    controls.register('finishTurn', () => {});