Skip to content

Commit

Permalink
Revert "Do not escape JSON"
Browse files Browse the repository at this point in the history
  • Loading branch information
sebdah authored Nov 17, 2020
1 parent 927dbef commit ba18026
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions v2/assertions.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,14 @@ func (g *Goldie) Assert(t *testing.T, name string, actualData []byte) {
// `a-z0-9\-\_` is a good idea).
func (g *Goldie) AssertJson(t *testing.T, name string, actualJsonData interface{}) {
t.Helper()
buf := &bytes.Buffer{}
enc := json.NewEncoder(buf)
enc.SetIndent("", " ")
enc.SetEscapeHTML(false)
err := enc.Encode(actualJsonData)
js, err := json.MarshalIndent(actualJsonData, "", " ")

if err != nil {
t.Error(err)
t.FailNow()
}

g.Assert(t, name, normalizeLF(buf.Bytes()))
g.Assert(t, name, normalizeLF(js))
}

// AssertXml compares the actual xml data received with expected data in the
Expand Down

0 comments on commit ba18026

Please sign in to comment.