MCPcopy
hub / github.com/nodejs/undici / MockClient

Class MockClient

types/mock-client.d.ts:9–19  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7
8/** MockClient extends the Client API and allows one to mock requests. */
9declare class MockClient extends Client implements Interceptable {
10 constructor (origin: string, options: MockClient.Options)
11 /** Intercepts any matching requests that use the same origin as this mock client. */
12 intercept (options: MockInterceptor.Options): MockInterceptor
13 /** Dispatches a mocked request. */
14 dispatch (options: Dispatcher.DispatchOptions, handlers: Dispatcher.DispatchHandler): boolean
15 /** Closes the mock client and gracefully waits for enqueued requests to complete. */
16 close (): Promise<void>
17 /** Clean up all the prepared mocks. */
18 cleanMocks (): void
19}
20
21declare namespace MockClient {
22 /** MockClient options. */

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…