gomega icon indicating copy to clipboard operation
gomega copied to clipboard

http handlers have better messaging

Open jtarchie opened this issue 5 years ago • 3 comments

When we use the ghttp matchers for verifying a request, we get vague messaging on what errored.

      Method mismatch
      Expected
          <string>: GET
      to equal
          <string>: POST

When I have 5+ requests being tested against, it is hard to determine which one is being affected. This gives no information about the expected request and the incoming request, the position of the expected request, etc.

I'd like to make a pull request to make the optional message for these assertions a bit more descriptive.

jtarchie avatar Nov 30 '20 14:11 jtarchie

go for it!

onsi avatar Nov 30 '20 14:11 onsi

Would it make sense to try to do it in every Verify matcher, or just against the VerifyRequest?

jtarchie avatar Nov 30 '20 14:11 jtarchie

My sense is they should all do it - I could imagine a shared prefix for all the _optional message_s that includes consistently formatted information about the received request. Thoughts?

onsi avatar Dec 01 '20 02:12 onsi