golden

package
v1.23.3 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2023 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Setup added in v1.10.0

func Setup()

Setup sets up the golden testing functionality for the package. It can be called instead of TestMain if a package wants to do multiple main function handling.

func Test

func Test(t testing.TB, output string)

Test checks the test output against the golden file where the path to the golden file is based on the test name; i.e. `testName.golden` within the `testdata` folder. If -golden-update was passed to "go test", it writes new golden files instead.

func TestAgainst added in v1.1.0

func TestAgainst(t testing.TB, goldenFileName string, output string)

TestAgainst checks the test output against the golden file. If -golden-update was passed to "go test", it writes new golden files instead.

func TestMain

func TestMain(m *testing.M)

TestMain sets up the golden testing functionality for the package. Packages that want to integrate golden testing should themselves implement TestMain and call this function.

Types

This section is empty.

Jump to

Keyboard shortcuts

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