Documentation ¶
Index ¶
- func AcceptanceTests(t *testing.T, reason string)
- func CleanSnapshots(m *testing.M)
- func LoadJSONFixture[V any](t *testing.T, path string) V
- func LoadJSONFixtureWithWindowsReplacements[V any](t *testing.T, path string, replacements map[string]string) V
- func Skip(t *testing.T, args ...any)
- func ValueIfOnWindows(win, or string) string
- type Snapshot
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AcceptanceTests ¶ added in v1.4.3
AcceptanceTests marks this test function as a extended that require additional dependencies automatically skipped unless running in a CI environment
func CleanSnapshots ¶ added in v1.6.2
CleanSnapshots ensures that snapshots are relevant and sorted for consistency
func LoadJSONFixture ¶
LoadJSONFixture returns the contents of the fixture file parsed as JSON
func LoadJSONFixtureWithWindowsReplacements ¶ added in v1.6.2
func LoadJSONFixtureWithWindowsReplacements[V any]( t *testing.T, path string, replacements map[string]string, ) V
LoadJSONFixtureWithWindowsReplacements returns the contents of the fixture file parsed as JSON after applying any replacements if running on Windows
func Skip ¶ added in v1.6.2
Skip is equivalent to t.Log followed by t.SkipNow, but allows tracking of what snapshots are skipped so that they're not marked as obsolete
func ValueIfOnWindows ¶ added in v1.5.0
Types ¶
type Snapshot ¶ added in v1.6.2
type Snapshot struct {
// contains filtered or unexported fields
}
func NewSnapshot ¶ added in v1.6.2
func NewSnapshot() Snapshot
NewSnapshot creates a snapshot that can be passed around within tests
func (Snapshot) MatchJSON ¶ added in v1.6.2
MatchJSON asserts the existing snapshot matches what was gotten in the test, after being marshalled as JSON