Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertGolden ¶
func AssertGolden(t *testing.T, assertionType GoldenAssertion, path string, actual []byte)
AssertGolden is a helper for "golden" or "snapshot" testing. It asserts that `actual`, a serialized YAML document, is equal to the one at `path`. If `-update` has been passed to `go test`, `actual` will be written to `path`.
func Context ¶
Context returns a context.Context that will cancel 1s before the t's deadline.
func MaybeCleanup ¶
MaybeCleanup is helper to invoke `fn` within a testing.T.Cleanup closure only if Retain returns false.
func Retain ¶
func Retain() bool
Retain returns the value of the -retain CLI flag. A value of true indicates that cleanup actions should be SKIPPED.
func TempDir ¶
TempDir is wrapper around testing.T.TempDir that respects Retain.
Types ¶
type GoldenAssertion ¶
type GoldenAssertion int
const ( YAML GoldenAssertion = iota JSON Text Bytes )
type TxTarGolden ¶
type TxTarGolden struct {
// contains filtered or unexported fields
}
func (*TxTarGolden) AssertGolden ¶
func (g *TxTarGolden) AssertGolden(t *testing.T, assertionType GoldenAssertion, path string, actual []byte)
Click to show internal directories.
Click to hide internal directories.