MocksFormat: "folder" | "har"

Specifies the mocks format to use. It can be defined globally through the mocksFormat setting or per-request from the hook method through setMocksFormat.

Remarks

Here are the two possible formats:

  • the folder format is specific to kassette and stores each request with its response in one folder containing up to 7 files: data.json (headers, status code and message of the response, as specified in MockData), body.[ext] (content of the body of the backend response), input-request.json (headers, method, URL and body file name of the input request, from client to proxy, for debug), input-request-body.[ext] (content of the body of the input request), forwarded-request.json (headers, method, URL, whether body was eventually a string or a Buffer and body file name of the forwarded request, from proxy to backend, for debug), forwarded-request-body.[ext] (the content of the body of the forwarded request), checksum (if a checksum was computed, the content generated to compute it). [ext] is an extension computed based on the actual type of the content in the file.

  • the har format is supported by several other tools and can store multiple requests with their responses in a single (json-based) file. In this file, each request/response couple follows the structure specified in HarFormatEntry.

Generated using TypeDoc