Documentation
¶
Overview ¶
Package testutil provides test utilities for contract and integration tests
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertNoErrors ¶
func AssertNoErrors(t *testing.T, resp *GraphQLResponse)
AssertNoErrors asserts that the GraphQL response has no errors
func GetTestServerURL ¶
func GetTestServerURL() string
GetTestServerURL returns the test server URL from environment or default
func UnmarshalData ¶
func UnmarshalData(t *testing.T, resp *GraphQLResponse, target interface{})
UnmarshalData unmarshals the GraphQL response data into the target struct
Types ¶
type GraphQLError ¶
type GraphQLError struct {
Message string `json:"message"`
Path []interface{} `json:"path,omitempty"`
Extensions map[string]interface{} `json:"extensions,omitempty"`
}
GraphQLError represents a GraphQL error
type GraphQLRequest ¶
type GraphQLRequest struct {
Query string `json:"query"`
Variables map[string]interface{} `json:"variables,omitempty"`
}
GraphQLRequest represents a GraphQL query request
type GraphQLResponse ¶
type GraphQLResponse struct {
Data json.RawMessage `json:"data"`
Errors []GraphQLError `json:"errors,omitempty"`
Extensions map[string]interface{} `json:"extensions,omitempty"`
}
GraphQLResponse represents a GraphQL query response
func ExecuteGraphQL ¶
func ExecuteGraphQL(t *testing.T, serverURL string, query string, variables map[string]interface{}) *GraphQLResponse
ExecuteGraphQL executes a GraphQL query against the test server
Click to show internal directories.
Click to hide internal directories.