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

    Interface MockHttpClient<TClient>

    A transport and the spy on its request, as createMockHttpClient builds them.

    interface MockHttpClient<TClient extends HttpClient> {
        client: TClient;
        requestSpy: MockInstance<
            <T = unknown>(config: HttpRequestConfig) => Promise<HttpResponse<T>>,
        >;
    }

    Type Parameters

    • TClient extends HttpClient

      The transport class under test.

    Index
    client: TClient

    The transport instance, of the class handed over.

    requestSpy: MockInstance<
        <T = unknown>(config: HttpRequestConfig) => Promise<HttpResponse<T>>,
    >

    The spy on the transport's request: stub it, then assert on its calls. Spelled as the method's own signature rather than HttpClient['request'], so the docs do not inherit the method's comment into a module that cannot resolve its links.