Documentation ¶
Index ¶
- func ExecuteCmd(newCmd func(*factory.Factory) *cobra.Command, args []string, ...) (string, error)
- func LoadFixture(p ...string) ([]byte, error)
- func NewFixture(p ...string) func() ([]byte, error)
- func RunTests(t *testing.T, newCmd func(*factory.Factory) *cobra.Command, tests []TestCase)
- type FakeGraphQLClient
- type TestCase
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExecuteCmd ¶
func ExecuteCmd(newCmd func(*factory.Factory) *cobra.Command, args []string, wantVariables map[string]interface{}) (string, error)
ExecuteCmd uses the passed in function to create a command and execute it
func LoadFixture ¶
Load the given file from the fixtures directory
func NewFixture ¶
Load the fixture at the given location
Types ¶
type FakeGraphQLClient ¶
type FakeGraphQLClient struct {
// contains filtered or unexported fields
}
type TestCase ¶
type TestCase struct { // Name of the test case Name string // Environment variables to be set for the test case Env map[string]string // Arguments to be passed to the CLI app Args []string // Expected output from the CLI app WantText string // Function to load extected output WantFixture func() ([]byte, error) // Expect output to be written to this file WantFile string // Expected values for the GraphQL query variables WantVariables map[string]interface{} // Text expected in error. Empty string means no error expected. ErrContains string }
Click to show internal directories.
Click to hide internal directories.