respondOnce
Only respond once with given overwrite. You can call respondOnce
multiple
consecutive times and it will start with the respond you defined last. If you
only use respondOnce
and the resource is called more times a mock has been
defined than it defaults back to the original resource.
#
Usage#
ParametersName | Type | Details |
---|---|---|
overwrites | MockOverwrite | payload to overwrite the response |
params optional | MockResponseParams | additional respond parameters to overwrite |
params.header optional | Object | overwrite specific headers |
params.statusCode optional | Number | overwrite response status code |
params.fetchResponse optional | Boolean | fetch real response before responding with mocked data |
#
ExamplerespondOnce.js