diff --git a/client_test.go b/client_test.go index b2c9e3b..c55cff4 100644 --- a/client_test.go +++ b/client_test.go @@ -52,9 +52,3 @@ func TestClient_Get_JSON(t *testing.T) { require.NoError(t, DeserializeJSON(resp, &v)) require.JSONEq(t, responseBody, string(MustInterceptResponseBody(resp))) } - -func printJSON(t *testing.T, v any) { - b, err := json.MarshalIndent(v, "", " ") - require.NoError(t, err) - t.Log(string(b)) -} diff --git a/httpassert/debug.go b/httpassert/debug.go new file mode 100644 index 0000000..96be4bb --- /dev/null +++ b/httpassert/debug.go @@ -0,0 +1,14 @@ +package httpassert + +import ( + "encoding/json" + "testing" + + "github.com/stretchr/testify/require" +) + +func PrintJSON(t *testing.T, v any) { + b, err := json.MarshalIndent(v, "", " ") + require.NoError(t, err) + t.Log(string(b)) +}