Reference / @getenginex/sdk/testing / MockHandler
MockHandler
MockHandler = (
req) =>Response|Promise<Response>
Handler for a createMockFetch route: receives the request and returns the response, usually built with ok or fail.
Parameters
req
Returns
Response | Promise<Response>
Example
ts
const routes = { 'GET /api/v1/config': () => ok({ version: '1.0' }) } satisfies Record<string, MockHandler>