Open smackfu opened 3 years ago
Thanks for opening your first issue. Pull requests are always welcome!
This issue is stale because it has been open 30 days with no activity.
Sorry for the late response on this.
I think it would be good to support this but I'm not sure if having the response body and status both be function is the right way to do it. Should the response itself be a function from which you could return the body and status? I'm definitely open to suggestions.
For more complex mocks, parrot supports passing a function as the body, which can be matched against the request object to return different responses.
See: https://github.com/americanexpress/parrot/blob/main/packages/parrot-core/src/utils/resolveResponse.js#L31
There are use-cases where it would be convenient to return a different http status code for different requests to the same endpoint.
Currently the status field does not support being passed a function: