Documentation
¶
Index ¶
Constants ¶
View Source
const ( // TestFixturesDir is the standard directory name for test fixtures. // This follows the Go convention of using "testdata" for test assets. TestFixturesDir = "testdata" // LegacyTestFixturesDir is the previous directory name used for test fixtures. // Files here will be automatically migrated to TestFixturesDir when accessed. LegacyTestFixturesDir = "test-fixtures" // GoldenFileDirName is the subdirectory within TestFixturesDir for golden files. GoldenFileDirName = "snapshot" // GoldenFileExt is the file extension for golden files. GoldenFileExt = ".golden" )
Variables ¶
View Source
var ( // GoldenFileDirPath is the full relative path to the golden files directory. GoldenFileDirPath = filepath.Join(TestFixturesDir, GoldenFileDirName) )
Functions ¶
func DangerText ¶
DangerText wraps text in ANSI escape codes for reverse red to make it highly visible.
func GetFixturePath ¶
GetFixturePath returns the path to a test fixture, automatically migrating from the legacy "test-fixtures" directory to "testdata" if needed. The migration happens transparently on first access.
func GetTestFixturesDir ¶
GetTestFixturesDir returns the fixture directory path, automatically migrating from the legacy "test-fixtures" directory if needed. This is useful for cases like afero.NewBasePathFs where you need the entire fixtures directory as a base.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.