INNER CODE UNIT · Go
TestDoNoResponse
machinebox/graphql · graphql_multipart_test.go:170
func TestDoNoResponse(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, `{
"data": {
"something": "yes"
}
}`)
}))
defer srv.Close()
ctx := context.Background()
client := NewClient(srv.URL, UseMultipartForm())