mwg API
    Preparing search index...

    Function exposeForTests

    • Publishes a game's inspectable state on window.__mwg_test__[name], where a browser test (BrowserDriver.evaluate) can reach it. One fixed place replaces a hook each game invents; a no-op outside a browser.

      Parameters

      • name: string
      • value: unknown

      Returns void

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

      declare const scene: unknown;
      declare const hitSound: unknown;
      exposeForTests('game', { scene, hitSound });
      // in the test: await driver.evaluate(() => window.__mwg_test__.game.hitSound.plays);