Ecosyste.ms: Packages

An open API service providing package, version and dependency metadata of many open source software ecosystems and registries.

Top 8.7% on proxy.golang.org
Top 1.8% dependent packages on proxy.golang.org
Top 2.5% dependent repos on proxy.golang.org

proxy.golang.org : github.com/jimeh/go-golden

Package golden is yet another package for working with *.golden test files, with a focus on simplicity through it's default behavior. Golden file names are based on the name of the test function and any subtest names by calling t.Name(). File names are sanitized to ensure they're compatible with Linux, macOS and Windows systems regardless of what crazy characters might be in a subtest's name. Typical usage should look something like this: The above example will read/write to: To update the golden file (have golden.Update() return true), simply set the GOLDEN_UPDATE environment variable to one of "1", "y", "t", "yes", "on", or "true" when running tests. As the golden filename is based on t.Name(), it works with sub-tests too, ensuring each sub-test gets it's own golden file. For example: The above example will read/write to: The "P" suffixed methods, GetP(), SetP(), and FileP(), all take a name argument which allows using specific golden files within a given *testing.T instance. The above example will read/write to: This works with tabular tests too of course: The above example will read/write to:

Registry - Source - Documentation - JSON
purl: pkg:golang/github.com/jimeh/go-golden
Keywords: go, go-golden, go-test, go-test-helper, go-testing, golang, golden-file
License: MIT
Latest release: over 2 years ago
First release: over 2 years ago
Namespace: github.com/jimeh
Dependent packages: 9
Dependent repositories: 4
Stars: 6 on GitHub
Forks: 0 on GitHub
See more repository details: repos.ecosyste.ms
Last synced: 18 days ago

    Loading...
    Readme
    Loading...