You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a scenario where I am setting up expectations to call an external service twice (mocking that in my tests using mock-https-server), one which returns an empty array and one that returns a response.
The only difference is what query params I use on that same exact path, however when setting up the test this seems to cause an issue since the handlers have the same path and the requests that come in are processed by the wrong handler. I looked at the library code but can't see an obvious place where this can be fixed.
Any ideas on how this sort of problem can be solved (if it can be) using this library or is this some sort of limitation of the library.
Thank You.
The text was updated successfully, but these errors were encountered:
I'm not sure I'm getting your use case. In the example provided, the two functions expectGetResourceByParamX() and expectGetResourceByParamY() are identical, but I would expect in the real world to differ. Depending on how they differ, you may end up with a different solution.
Generally speaking, I would suggest you to look at the fact that the body can also be specified as body: function(req) {}: this way you can dinamically generate the response based on the request, but you can also keep track of each received request for later inspection / assertion on it.
I have a scenario where I am setting up expectations to call an external service twice (mocking that in my tests using mock-https-server), one which returns an empty array and one that returns a response.
something like this:
The only difference is what query params I use on that same exact path, however when setting up the test this seems to cause an issue since the handlers have the same path and the requests that come in are processed by the wrong handler. I looked at the library code but can't see an obvious place where this can be fixed.
Any ideas on how this sort of problem can be solved (if it can be) using this library or is this some sort of limitation of the library.
Thank You.
The text was updated successfully, but these errors were encountered: