API Core - v1.5.0
    Preparing search index...

    Function createMockHttpClient

    • Spin up a transport and a vitest spy on its request method in one call. The class is a parameter because each SDK's transport is its own thin HttpClient subclass — the one seating its redaction vocabulary, and the one its instanceof resolver accepts.

      Type Parameters

      • TClient extends HttpClient

        The transport class under test.

      Parameters

      • clientClass: new (config: HttpClientConfig) => TClient

        The transport class to instantiate.

      • baseURL: string

        Base URL the transport is pinned to.

      Returns MockHttpClient<TClient>

      The wired client and a spy on its request.