Allow to fail fast if any of the httpexpect checks don't hold true #459
Unanswered
roma-glushko
asked this question in
Q&A
Replies: 1 comment
-
For fail fast, you can use RequireReporter or FatalReporter or PanicReporter, instead of AssertReporter. See here: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Description
I would like httpexpect check to actually fail and halt the whole test execution if any of them are violated.
Let's consider the following example:
I read this snippet like this:
payload
to the/oauth/callback/
Expected Behaviour
When expectations fail (e.g. the response is not a plain text or status is 412, let's say), I would expect the whole test to fail right there.
Actual Behaviour
httpexpect says that the expectation is failed in the logs, but the test is keep running leading to issues like empty ID of the authorization, let's say, and potential violation of other downstream checks and requests.
The current workaround is to guard the code with additional
require.*
statements but bloats the test:Hence, httpexpect already knows about our expectations, would not it be nice to eliminate that redundant code and fail early as a part of the httpexpect checks?
Beta Was this translation helpful? Give feedback.
All reactions