MCPcopy Create free account
hub / github.com/conforma/cli / matchFileSnapshot

Function matchFileSnapshot

acceptance/cli/cli.go:793–809  ·  view source on GitHub ↗
(ctx context.Context, file string)

Source from the content-addressed store, hash-verified

791}
792
793func matchFileSnapshot(ctx context.Context, file string) error {
794 status, err := ecStatusFrom(ctx)
795 if err != nil {
796 return err
797 }
798
799 expanded := os.Expand(file, func(key string) string {
800 return status.vars[key]
801 })
802
803 content, err := os.ReadFile(expanded)
804 if err != nil {
805 return err
806 }
807
808 return snaps.MatchSnapshot(ctx, file, string(content), status.vars)
809}
810
811func createGenericFile(ctx context.Context, name string, content *godog.DocString) (context.Context, error) {
812 ctx, _, vars, err := variables(ctx)

Callers

nothing calls this directly

Calls 2

MatchSnapshotFunction · 0.92
ecStatusFromFunction · 0.85

Tested by

no test coverage detected