Replies: 1 comment
-
I think the first solution is good in the way that the test is a self-contained (having everything it needs in it) which I think we should aim for in most cases, but adds a lot of code to the test making it less readable The 2nd solution although may raise eyebrows but I think it's the best solution as in the majority of the tests you want to have a successful request in the So I would go with the 2nd option |
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
-
I want to appeal this decision.
Currently, we recommend overriding Axios' default behavior to not validate the response status code.
I find this behavior inconvenient and error-prone because we're using the same Axios client also for the
arrange
phase which results to unexpected behavior of the test.For example, this test may pass even if one of the requests in the
arrange
phase fails:Another point, this reduce test "debugability" in complex
arrange
scenarios because we don't "fail-fast" and you need to figure out the root cause:This test result is
expected 200, got 500
, which hides the real root cause.The solutions I see:
arrange
and one foract
.Beta Was this translation helpful? Give feedback.
All reactions