mockit
mockit copied to clipboard
Add support for setting cookies in responses
It would be great if one could configure endpoints to send cookies in the response.
Hey @modernist
Got any ideas on how this would look?
For example:
Would this feature accept key, value pairs from the user on each response? and we could use res.cookie('cookieName', 'value');
something like this to send the values in the responses?
I guess an interface similar to the one provided in Postman / Insomnia for setting cookies on requests would be adequate. So, a list of key/value pairs per endpoint would be more than enough as a first step. Later on it would be possible to define cookies that are sent on every endpoint, but whose value can be customized per endpoint, and finally perhaps create some rules that allow the generation of random values (e.g. numbers / strings / dates)