golden

package
v1.2.3-fred.3 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(t *testing.T) []byte

Get returns the contents of the golden file for the current test. If there is no golden file for the test, the test will be failed.

func GetNamed

func GetNamed(t *testing.T, name string) []byte

GetNamed returns the contents of a named golden file for the current test. If the specified golden file does not exist for the test, the test will be failed.

func Set

func Set(t *testing.T, data []byte)

Set writes the supplied data to the golden file for the current test.

func SetNamed

func SetNamed(t *testing.T, name string, data []byte)

SetNamed writes the supplied data to a named golden file for the current test.

func ShouldSet

func ShouldSet() bool

ShouldSet provides a boolean value that indicates if your code should then call `Set` or `SetNamed` to update the stored golden file value with new data.

Types

This section is empty.

Jump to

Keyboard shortcuts

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