Testing: $response->assertStatus() should print out the last error #51138
Replies: 2 comments
-
Seems like this did indeed work in Laravel 10 and somehow broke in 11 |
Beta Was this translation helpful? Give feedback.
0 replies
-
I'll be closing this discussion since it seems to be a bug #51154 |
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
Uh oh!
There was an error while loading. Please reload this page.
-
When using feature tests that fail because of an error it's often not clear which error actually caused the failure. Instead when asserting a specific status code one just gets
Expected response status code [xxx] but received 500
while the actual exception is hidden somewhere in the logs.It would be useful if the last error that was thrown during that request was appended to the message. Debugging failed feature tests would become a lot easier.
This could be achieved by modifying the
statusMessageWithDetails
method inTestResponse.php
I feel like exceptions were printed to the console in the past but maybe that was never the case. If this is generally something people care about I'll make a pull request.
Beta Was this translation helpful? Give feedback.
All reactions