snaps

package
v0.0.0-...-ad4ad90 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2022 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clean

func Clean(t *testing.M)

Clean runs checks for identifying obsolete snapshots and prints a Test Summary.

Must be called in a TestMain

func TestMain(t *testing.M) {
 v := t.Run()

 // After all tests have run `go-snaps` can check for not used snapshots
 snaps.Clean(t)

 os.Exit(v)
}

func MatchSnapshot

func MatchSnapshot(t testingT, values ...interface{})

MatchSnapshot verifies the values match the most recent snap file

You can pass multiple values

MatchSnapshot(t, 10, "hello world")

or call MatchSnapshot multiples times inside a test

MatchSnapshot(t, 10)
MatchSnapshot(t, "hello world")

The difference is the latter will create multiple entries.

func Skip

func Skip(t testingT, args ...interface{})

Wrapper of testing.Skip

Keeps track which snapshots are getting skipped and not marked as obsolete.

func SkipNow

func SkipNow(t testingT)

Wrapper of testing.SkipNow

Keeps track which snapshots are getting skipped and not marked as obsolete.

func Skipf

func Skipf(t testingT, format string, args ...interface{})

Wrapper of testing.Skipf

Keeps track which snapshots are getting skipped and not marked as obsolete.

Types

This section is empty.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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