You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In our backend we employ JSON error responses to inform the client of what went wrong exactly.
This can be a missing field (400), which would then contain a body like:
{
"error_code" : "missing_field_y"
}
In order to verify that the app correctly passes this information, I'm writing a test to verify that the parsing goes correctly.
However, when creating a Mock object the following way, it seems to default to a successful response.
In our backend we employ JSON error responses to inform the client of what went wrong exactly.
This can be a missing field (
400
), which would then contain a body like:In order to verify that the app correctly passes this information, I'm writing a test to verify that the parsing goes correctly.
However, when creating a
Mock
object the following way, it seems to default to a successful response.Do you have any suggestions on how to work around this?
(P.S. It's also inconvenient that passing
data
encoded with Swift 4'sJSONEncoder
is not working but results in aninvalid_api_response
)The text was updated successfully, but these errors were encountered: