mockhttp icon indicating copy to clipboard operation
mockhttp copied to clipboard

Feedback about 404

Open mercer opened this issue 4 years ago • 1 comments

I'm facing an issue trying to get more feedback from mockhttp

  1. when I setup my mock, either with When style, or Expected style
  2. when implementation slightly changes, for example a field in a request is serialized wrongly, so potentially introducing a bug
  3. mockhttp returns 404, as the request no longer matches the setup
  4. but then it's not really clear what happened, and one will need to look at 10-20 different things to understand what changed
  5. and also be aware that 404 could mean any change in implementation for: url, verb, parameters, headers, request

Now

  1. perhaps there is a way to setup the test, to tell me where exactly the test failed in expected vs actual
  2. didn't notice an example of this in the documentation (did not read everything though)
  3. I also thought a different behaviour on this issue for When vs Expected style (but both gave me 404)

Awesome library, btw :heart:

mercer avatar Jun 26 '20 08:06 mercer

This is a great idea. I did actually start down this path, but I ended up getting stuck trying to avoid changing any public APIs. I'll take a another look at this at somepoint.

richardszalay avatar Jul 12 '22 11:07 richardszalay

I'm having the same issue, I can't understand why my mocks are returning 404, but they are 😢

alexrosenfeld10 avatar Jul 18 '23 19:07 alexrosenfeld10

Version 7.0.0 now defaults to a thrown exception for unmatched requests and the exception message includes a full rundown of what did / did not match. Appreciate any feedback, and thanks for your patience on this one.

richardszalay avatar Oct 12 '23 10:10 richardszalay