Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GraphQLClientMock ¶
type GraphQLClientMock struct { // QueryFunc mocks the Query method. QueryFunc func(ctx context.Context, query interface{}, vars map[string]interface{}) error // contains filtered or unexported fields }
GraphQLClientMock is a mock implementation of GraphQLClient.
func TestSomethingThatUsesGraphQLClient(t *testing.T) { // make and configure a mocked GraphQLClient mockedGraphQLClient := &GraphQLClientMock{ QueryFunc: func(ctx context.Context, query interface{}, vars map[string]interface{}) error { panic("mock out the Query method") }, } // use mockedGraphQLClient in code that requires GraphQLClient // and then make assertions. }
func (*GraphQLClientMock) Query ¶
func (mock *GraphQLClientMock) Query(ctx context.Context, query interface{}, vars map[string]interface{}) error
Query calls QueryFunc.
func (*GraphQLClientMock) QueryCalls ¶
func (mock *GraphQLClientMock) QueryCalls() []struct { Ctx context.Context Query interface{} Vars map[string]interface{} }
QueryCalls gets all the calls that were made to Query. Check the length with:
len(mockedGraphQLClient.QueryCalls())
Click to show internal directories.
Click to hide internal directories.