snap

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 9, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeMultiSnapshots added in v0.3.0

func DecodeMultiSnapshots(raw []byte) (multiSnap, error)

func EncodeMultiSnapshots added in v0.3.0

func EncodeMultiSnapshots(snaps multiSnap) ([]byte, error)

func IsMultiSnapshots added in v0.3.0

func IsMultiSnapshots(filePath string) bool

func ReadFile added in v0.3.0

func ReadFile(path string) ([]byte, error)

func RemoveFile added in v0.3.0

func RemoveFile(path string) error

func SetLogger added in v0.0.6

func SetLogger(slogr *slog.Logger)

func SnapshotMatcher added in v0.3.0

func SnapshotMatcher(snapFile string, options ...Option) *snapshotMatcher

SnapshotMatcher returns a matcher that compares the actual value with the snapshot file.

func WriteFile added in v0.3.0

func WriteFile(path string, data []byte) error

Types

type DiffFunc added in v0.3.0

type DiffFunc func(x, y string) string

type Option

type Option func(m *snapshotMatcher)

Option is a functional option for snapshotMatcher.

func WithDiffFunc added in v0.3.0

func WithDiffFunc(f DiffFunc) Option

func WithSnapshotID added in v0.3.0

func WithSnapshotID(id string) Option

WithSnapshotID is an option to specify the snapshot ID. If this option is set, the snapshot file is treated as a multi-snapshot file.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL