FaasJS
Home
  • Guide
  • Documents
  • Templates
  • Changelog
  • Ecosystem

    • Docker Images
  • Github
  • Contributing
  • Sponsor
  • Security
Home
  • Guide
  • Documents
  • Templates
  • Changelog
  • Ecosystem

    • Docker Images
  • Github
  • Contributing
  • Sponsor
  • Security

Documents / @faasjs/react / MockHandler

Type Alias: MockHandler

MockHandler = (action, params, options) => Promise<ResponseProps> | Promise<void> | Promise<Error>

Mock handler function type for testing FaasJS requests.

The handler receives the action path, request params, and fully resolved request options. Returning an Error makes the request reject with a response error; returning nothing creates an empty successful response.

Parameters

action

string

params

Record<string, any> | undefined

options

Options

Returns

Promise<ResponseProps> | Promise<void> | Promise<Error>