Skip to content

Commit e155c6d

Browse files
authored
doc(mock): update out-of-date reply documentation (#1913)
1 parent 87fa734 commit e155c6d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

docs/api/MockPool.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ Returns: `MockInterceptor` corresponding to the input options.
6363

6464
We can define the behaviour of an intercepted request with the following options.
6565

66-
* **reply** `(statusCode: number, replyData: string | Buffer | object | MockInterceptor.MockResponseDataHandler, responseOptions?: MockResponseOptions) => MockScope` - define a reply for a matching request. You can define this as a callback to read incoming request data. Default for `responseOptions` is `{}`.
66+
* **reply** `(statusCode: number, replyData: string | Buffer | object | MockInterceptor.MockResponseDataHandler, responseOptions?: MockResponseOptions) => MockScope` - define a reply for a matching request. You can define the replyData as a callback to read incoming request data. Default for `responseOptions` is `{}`.
67+
* **reply** `(callback: MockInterceptor.MockReplyOptionsCallback) => MockScope` - define a reply for a matching request, allowing dynamic mocking of all reply options rather than just the data.
6768
* **replyWithError** `(error: Error) => MockScope` - define an error for a matching request to throw.
6869
* **defaultReplyHeaders** `(headers: Record<string, string>) => MockInterceptor` - define default headers to be included in subsequent replies. These are in addition to headers on a specific reply.
6970
* **defaultReplyTrailers** `(trailers: Record<string, string>) => MockInterceptor` - define default trailers to be included in subsequent replies. These are in addition to trailers on a specific reply.

0 commit comments

Comments
 (0)