Documents / @faasjs/request / setMock
Function: setMock()
setMock(
handler
):void
Mock requests
Parameters
• handler: Mock
{function | null} null to disable mock
Returns
void
Example
setMock(async (url, options) => Promise.resolve({ headers: {}, statusCode: 200, body: { data: 'ok' } }))