Stone.js API
    Preparing search index...
    • Ask the core to select a given platform, before it selects anything.

      An application may stack several contexts — HTTP and CLI, a browser and a server — and a test that wants a specific one has to say so before the selection happens, so every platform-conditional contribution lines up behind the same answer. This uses the core's own matching rule (adapters.find(v => v.platform === current?.platform)) rather than a mechanism of its own.

      It also covers the case a pure SPA runs into: neither the browser nor the console adapter declares itself default, so nothing is selected and there is no response contract to inherit. Naming the platform is what turns that into a testable context.

      Parameters

      • platform: string

        The platform to select.

      Returns (
          context: BlueprintContext<IBlueprint, ClassType>,
          next: NextMiddleware<BlueprintContext<IBlueprint, ClassType>, IBlueprint>,
      ) => Promise<IBlueprint>

      The blueprint middleware.