Documentation
¶
Overview ¶
Package golden provides standard way to write tests with golden files.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EqualString ¶
EqualString asserts that the golden file content is equal to the data in string format.
func File ¶
File returns the golden file content for the test. If OVERRIDE_TEST_DATA env is set to true, the golden file will be created with the content of the data. OVERRIDE_TEST_DATA is read only once at the start of the test and it's value is not updated. Depending of the test structure the golden file and it's directories arew created in ./testdata/{testFuncName}/{subTestName}.golden or ./testdata/{testFuncName}/{testFuncName}.golden.
func FileString ¶
FileString returns the output of golden.File as a string.
Types ¶
Click to show internal directories.
Click to hide internal directories.