Closed sandinmyjoints closed 4 years ago
Is this possible to do @yinzara?
Absolutely. They also accept a function that accepts a http.Request and returns a boolean of true or false.
fetch.doMockIf(req => req.method === "POST")
Maybe we can add this as an example!
It already is. See Readme.md in the "Functions" section :)
The various mock-if conditionals take the url as input, but it'd be great to have a way to choose whether to mock or not based on HTTP method, for example, only mock POSTs.