INNER CODE UNIT · Go
TestDoErr
machinebox/graphql · graphql_multipart_test.go:93
func TestDoErr(t *testing.T) {
is := is.New(t)
var calls int
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
calls++
is.Equal(r.Method, http.MethodPost)
query := r.FormValue("query")
is.Equal(query, `query {}`)
io.WriteString(w, `{
"errors": [{
"message": "Something went wrong"
}]
}`)
}))
defer srv.Close()
ctx := context.Background()
client := NewClient(srv.URL, UseMultipartForm())