testutility

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AcceptanceTests added in v1.4.3

func AcceptanceTests(t *testing.T, reason string)

AcceptanceTests marks this test function as a extended that require additional dependencies automatically skipped unless running in a CI environment

func AssertMatchFixtureJSON

func AssertMatchFixtureJSON[V any](t *testing.T, path string, val V)

AssertMatchFixtureJSON matches the JSON at path with the value val, failing if not equal, printing out the difference.

func AssertMatchFixtureText added in v1.4.1

func AssertMatchFixtureText(t *testing.T, path string, actual string)

AssertMatchFixtureText matches the Text file at path with actual

func CreateJSONFixture deprecated

func CreateJSONFixture[V any](t *testing.T, path string, val V)

Deprecated: Not actually deprecated, deprecated tag used to warn users from checking in as it's meant to be used as a helper func to generate fixtures

CreateJSONFixture creates a JSON file at path of the value val, can be used with AssertMatchFixtureJSON to compare against future values.

func CreateTextFixture added in v1.4.1

func CreateTextFixture(t *testing.T, path string, val string)

CreateTextFixture creates a text file at path of the value val, can be used with AssertMatchFixtureJSON to compare against future values.

func LoadJSONFixture

func LoadJSONFixture[V any](t *testing.T, path string) V

LoadJSONFixture loads a JSON fixture file and returns the decoded version.

func ValueIfOnWindows added in v1.5.0

func ValueIfOnWindows(win, or string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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