Skip to content

Commit

Permalink
feat: add golden string sanitizer option (#1109)
Browse files Browse the repository at this point in the history
  • Loading branch information
bharathkkb authored Apr 1, 2022
1 parent ada395c commit 0e962c6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions infra/blueprint-test/pkg/golden/golden.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ func WithSanitizer(s Sanitizer) goldenFileOption {
}
}

func WithStringSanitizer(old, new string) goldenFileOption {
return func(g *GoldenFile) {
g.sanitizers = append(g.sanitizers, StringSanitizer(old, new))
}
}

func NewOrUpdate(t testing.TB, data string, opts ...goldenFileOption) *GoldenFile {
g := &GoldenFile{
dir: gfDir,
Expand Down

0 comments on commit 0e962c6

Please sign in to comment.