Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckAgainstGoldenFile ¶
func CheckAgainstGoldenFile(t *testing.T, got map[string]interface{}, goldenDir, testName string, update *bool, opts *CompareOptions)
CheckAgainstGoldenFile sees if the JSON serialization of what we got matches a golden file.
got is the object we're testing. It will be rendered as JSON & compared with the golden file goldenDir defines the directory that holds golden files. testName is the name of the test, which will be sluggified to determine the golden file to use update is a flag that determines if we should update the golden file.
Types ¶
type CompareOptions ¶
type CompareOptions struct { // Whether to ignore date/times when comparing or writing the golden // file to disk DateTimeAgnostic bool }
CompareOptions struct
type ConsumerContract ¶
type ConsumerContract struct { GeneratedAt time.Time `yaml:"generatedAt"` Operations map[string]Operation `yaml:"operations"` }
ConsumerContract struct
type QueryRegistry ¶
type QueryRegistry struct {
// contains filtered or unexported fields
}
QueryRegistry struct
func LoadQueryRegistry ¶
func LoadQueryRegistry(t *testing.T, queryDir, consumerContractFile string) *QueryRegistry
LoadQueryRegistry function
func (QueryRegistry) MustGet ¶
func (reg QueryRegistry) MustGet(opName string) Document
MustGet function
func (QueryRegistry) NewRequest ¶
func (reg QueryRegistry) NewRequest(opName string) *graphql.Request
NewRequest fuction
func (QueryRegistry) Register ¶
func (reg QueryRegistry) Register(opName string, document Document) error
Register function
func (QueryRegistry) UnusedOperations ¶
func (reg QueryRegistry) UnusedOperations() []string
UnusedOperations function
Click to show internal directories.
Click to hide internal directories.