Documentation
¶
Overview ¶
Snapshot testing utilities for integration tests
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SnapshotFiles ¶
SnapshotFiles is a convenience function for common snapshot testing
Types ¶
type Snapshot ¶
type Snapshot struct {
Name string `json:"name"`
Files map[string]string `json:"files"` // relPath -> content
Metadata map[string]any `json:"metadata"` // Additional test metadata
}
Snapshot represents a saved test snapshot
type SnapshotConfig ¶
type SnapshotConfig struct {
UpdateSnapshots bool // Set to true to update all snapshots (via -update flag)
}
SnapshotConfig controls snapshot behavior
type SnapshotMatcher ¶
type SnapshotMatcher struct {
// contains filtered or unexported fields
}
SnapshotMatcher handles snapshot comparison and updates
func NewSnapshotMatcher ¶
func NewSnapshotMatcher(t *testing.T, testName string) *SnapshotMatcher
NewSnapshotMatcher creates a new snapshot matcher for a test
func (*SnapshotMatcher) MatchSnapshot ¶
func (sm *SnapshotMatcher) MatchSnapshot(sitePath string, filesToCheck []string)
MatchSnapshot compares generated files against saved snapshot
func (*SnapshotMatcher) MatchSnapshotWithMetadata ¶
func (sm *SnapshotMatcher) MatchSnapshotWithMetadata(sitePath string, filesToCheck []string, metadata map[string]any)
MatchSnapshotWithMetadata compares snapshot with additional metadata
Click to show internal directories.
Click to hide internal directories.