Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type GoldenTest ¶
type GoldenTest[T any] struct { // FileExtension defaults to '.json'. FileExtension string // Marshal defaults to a wrapper around json.MarshalIndent Marshal func(v any) ([]byte, error) // Unmarshal defaults to json.Unmarshal Unmarshal func(data []byte, v any) error // Compare defaults to require.Compare Compare func(t testing.TB, expected, actual T) }
GoldenTest is a helper for "golden tests," which compare an actual output to a known good output that's saved to a file and committed to the repository.
Click to show internal directories.
Click to hide internal directories.