Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ColorDiffer ¶ added in v0.2.0
type ColorDiffer struct{}
func (ColorDiffer) Diff ¶ added in v0.2.0
func (ColorDiffer) Diff(snapshot, received []byte) []byte
type Differ ¶ added in v0.2.0
var (
DefaultDiffer Differ = &ColorDiffer{}
)
nolint: gochecknoglobals
type DumpSerializer ¶
type DumpSerializer struct {
Config *spew.ConfigState
}
type JSONSerializer ¶
type Matcher ¶
type Matcher struct { Serializer Serializer Transformer Transformer Storage Storage Differ Differ UpdateFile bool }
func (*Matcher) FailureMessage ¶
func (*Matcher) NegatedFailureMessage ¶
type NopTransformer ¶
type NopTransformer struct{}
func (NopTransformer) Transform ¶
func (NopTransformer) Transform(input interface{}) (interface{}, error)
type Option ¶ added in v0.3.0
type Option func(*Matcher)
func WithDescription ¶ added in v0.3.0
WithDescription adds an optional description to the golden file, allowing multiple gold files per test.
func WithDiffer ¶ added in v0.4.0
WithDiffer overrides the default differ.
func WithSerializer ¶ added in v0.4.0
func WithSerializer(serializer Serializer) Option
WithSerializer overrides the default serializer.
func WithStorage ¶ added in v0.4.0
WithStorage overrides the default storage.
func WithTransformer ¶ added in v0.4.0
func WithTransformer(transformer Transformer) Option
WithTransformer overrides the default transformer.
type Serializer ¶
var (
DefaultSerializer Serializer = &DumpSerializer{
Config: newDefaultDumpConfig(),
}
)
nolint: gochecknoglobals
type SingleStorage ¶ added in v0.2.0
func (*SingleStorage) Read ¶ added in v0.2.0
func (s *SingleStorage) Read() ([]byte, error)
func (*SingleStorage) Write ¶ added in v0.2.0
func (s *SingleStorage) Write(data []byte) error
type StringSerializer ¶ added in v0.4.0
type StringSerializer struct {
FallbackSerializer Serializer
}
type SuiteStorage ¶ added in v0.2.0
func (*SuiteStorage) Read ¶ added in v0.2.0
func (s *SuiteStorage) Read() ([]byte, error)
func (*SuiteStorage) Write ¶ added in v0.2.0
func (s *SuiteStorage) Write(input []byte) error
type TOMLSerializer ¶
type TOMLSerializer struct {
Indent string
}
type Transformer ¶
type Transformer interface {
Transform(input interface{}) (interface{}, error)
}
var (
DefaultTransformer Transformer = &NopTransformer{}
)
nolint: gochecknoglobals
type YAMLSerializer ¶
type YAMLSerializer struct{}
Click to show internal directories.
Click to hide internal directories.