main
Last change
on this file was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago |
F4 Finalna Verzija
|
-
Property mode
set to
100644
|
File size:
1002 bytes
|
Line | |
---|
1 | import Client from './client'
|
---|
2 | import Dispatcher from './dispatcher'
|
---|
3 | import MockAgent from './mock-agent'
|
---|
4 | import { MockInterceptor, Interceptable } from './mock-interceptor'
|
---|
5 |
|
---|
6 | export default MockClient
|
---|
7 |
|
---|
8 | /** MockClient extends the Client API and allows one to mock requests. */
|
---|
9 | declare 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.DispatchHandlers): boolean;
|
---|
15 | /** Closes the mock client and gracefully waits for enqueued requests to complete. */
|
---|
16 | close(): Promise<void>;
|
---|
17 | }
|
---|
18 |
|
---|
19 | declare namespace MockClient {
|
---|
20 | /** MockClient options. */
|
---|
21 | export interface Options extends Client.Options {
|
---|
22 | /** The agent to associate this MockClient with. */
|
---|
23 | agent: MockAgent;
|
---|
24 | }
|
---|
25 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.