Stone.js API
    Preparing search index...

    Function makeIncomingBrowserEvent

    • Build a ready-to-dispatch IncomingBrowserEvent for tests.

      This is the event a browser application and a React Native one actually receive, and the reason it has to exist separately from makeIncomingEvent: the React renderer keys its hydration snapshot on event.fingerprint(), which the platform-agnostic event does not carry. Dispatching the agnostic one into a rendering application fails with event.fingerprint is not a function, from inside the kernel's error handler, which says nothing about what is missing.

      It lives behind @stone-js/testing/browser so that @stone-js/browser-core is only needed by the projects that render: a service has no reason to install a browser package to run its tests.

      Parameters

      Returns IncomingBrowserEvent

      The incoming browser event.

      const app = await createTestApp({ platform: REACT_NATIVE_PLATFORM })
      const response = await app.send(makeIncomingBrowserEvent({ url: 'myapp://tasks/42' }))