MCPcopy Create free account
hub / github.com/goadesign/goa / NewGoldenFile

Function NewGoldenFile

codegen/testutil/golden.go:59–70  ·  view source on GitHub ↗

NewGoldenFile creates a new GoldenFile instance with default options

(t testing.TB, basePath string)

Source from the content-addressed store, hash-verified

57
58// NewGoldenFile creates a new GoldenFile instance with default options
59func NewGoldenFile(t testing.TB, basePath string) *GoldenFile {
60 t.Helper()
61 return &GoldenFile{
62 t: t,
63 basePath: func() string {
64 if basePath != "" {
65 return basePath
66 }
67 return DefaultBasePath
68 }(),
69 }
70}
71
72// Content sets the content to compare (fluent API)
73func (g *GoldenFile) Content(content []byte) *GoldenFile {

Callers 4

TestWithSubtestsFunction · 0.92
TestParallelUpdatesFunction · 0.92
TestGoldenFileFunction · 0.92
CompareOrUpdateGoldenFunction · 0.85

Calls

no outgoing calls

Tested by 3

TestWithSubtestsFunction · 0.74
TestParallelUpdatesFunction · 0.74
TestGoldenFileFunction · 0.74