printing body when unexpected status code #137
Replies: 4 comments
-
Hi, I think this makes sense and actually we already have an issue for a very similar feature: #69. Will it solve your problem? The issue is still in progress though. |
Beta Was this translation helpful? Give feedback.
-
yep that looks absolutely great! :) |
Beta Was this translation helpful? Give feedback.
-
This feature is not implemented yet, however #69 is finished and now httpexpect allows to implement it in user code. See https://github.com/gavv/httpexpect#customize-failure-formatting and https://github.com/gavv/httpexpect#customize-assertion-handling Also I will create an issue for implementing this functionality inside httpexpect. |
Beta Was this translation helpful? Give feedback.
-
I've created issue: #159 |
Beta Was this translation helpful? Give feedback.
-
Hi 👋
I would like to know if you would be interested in having a new
Expect().Status(x)
behavior that would print out the response body if the status is not as expected.My motivation is that i want to write scenarios instead of unitary endpoint tests. And for that, i need to use the "Require" reporter that will stop immediately after the first error encountered, otherwise the results are completely broken after the first failure :)
I have an idea for implementation: through configuration, being able to provide a custom status formatter/checker instead of the default, current implementation. This formatter/checker would be called after the chain check and receive the response as parameter.
What do you think?
Beta Was this translation helpful? Give feedback.
All reactions