diff --git a/types/index.d.ts b/types/index.d.ts index a5afa6b..60940ab 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -12,6 +12,7 @@ type ResponseSpecFunc = ( declare namespace MockAdapter { export interface RequestHandler { + withDelayInMs(delay: number): RequestHandler; reply: ResponseSpecFunc; replyOnce: ResponseSpecFunc; passThrough(): MockAdapter; diff --git a/types/test.ts b/types/test.ts index e17a164..c1301b9 100644 --- a/types/test.ts +++ b/types/test.ts @@ -125,6 +125,10 @@ namespace SupportsNetworkErrorOnce { mock.onGet().networkErrorOnce(); } +namespace withDelayInMs { + mock.onGet().withDelayInMs(2000).reply(200, { data: 'foo' }); +} + namespace AllowsFunctionReply { mock.onGet().reply(config => { return [200, { data: 'foo' }, { RequestedURL: config.url }];