-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Closed
Description
I'm writing an API using echo and adding tests to it as I go, and I've found a problem that I don't know how to solve
In every single request that requires the binding of a body to a struct I have to add a test case for if the binding fails
var loginInfo model.UnsafeUser
if err := echo.Bind(&loginInfo); err != nil {
return echo.JSON(http.StatusBadRequest, "Bad username and password combination")
}
Something like this bit of code above, do you guys have any solution for it other then just adding the same test to every single test file?
Metadata
Metadata
Assignees
Labels
No labels