Requires exactly one URL matcher.Documentation Index
Fetch the complete documentation index at: https://momentic.ai/docs/llms.txt
Use this file to discover all available pages before exploring further.
responseGenerator is a JavaScript function
body evaluated for every match. It receives the captured mock.request (and
mock.response when fetchOriginalResponse is set) and returns the response
body.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
substring | string | No | Match URLs that contain this substring. |
glob | string | No | Match URLs against a glob pattern. |
regex | string | No | Match URLs against a regular expression. |
domain | string | No | Match all URLs under the given domain. |
method | string | No | Restrict mocking to a specific HTTP method. |
responseGenerator | string | Yes | JavaScript expression that returns the response body. |
fetchOriginalResponse | boolean | No | Make the real request first and pass the response to the generator. |
key | string | No | Stable key for removeRouteMock. |
saveAs | string | No | Name of the variable to write this step’s return value to. |
retries | number | No | Number of times to retry the step on failure before failing the test. |
skipped | boolean | No | Skip this step at execution time. |
comment | string | No | Free-form annotation kept with the step. |