mirror of
https://github.com/TwiN/gatus.git
synced 2024-11-24 17:04:42 +01:00
test: Improve error readability
This commit is contained in:
parent
34f8cd1eca
commit
d01a5d418b
@ -177,7 +177,7 @@ func TestAlertProvider_buildRequestBody(t *testing.T) {
|
|||||||
b, _ := json.Marshal(body)
|
b, _ := json.Marshal(body)
|
||||||
e, _ := json.Marshal(scenario.ExpectedBody)
|
e, _ := json.Marshal(scenario.ExpectedBody)
|
||||||
if body != scenario.ExpectedBody {
|
if body != scenario.ExpectedBody {
|
||||||
t.Errorf("expected %s, got %s", e, b)
|
t.Errorf("expected:\n%s\ngot:\n%s", e, b)
|
||||||
}
|
}
|
||||||
out := make(map[string]interface{})
|
out := make(map[string]interface{})
|
||||||
if err := json.Unmarshal([]byte(body), &out); err != nil {
|
if err := json.Unmarshal([]byte(body), &out); err != nil {
|
||||||
|
@ -142,7 +142,7 @@ func TestAlertProvider_buildRequestBody(t *testing.T) {
|
|||||||
scenario.Resolved,
|
scenario.Resolved,
|
||||||
)
|
)
|
||||||
if string(body) != scenario.ExpectedBody {
|
if string(body) != scenario.ExpectedBody {
|
||||||
t.Errorf("expected %s, got %s", scenario.ExpectedBody, body)
|
t.Errorf("expected:\n%s\ngot:\n%s", scenario.ExpectedBody, body)
|
||||||
}
|
}
|
||||||
out := make(map[string]interface{})
|
out := make(map[string]interface{})
|
||||||
if err := json.Unmarshal([]byte(body), &out); err != nil {
|
if err := json.Unmarshal([]byte(body), &out); err != nil {
|
||||||
|
@ -93,7 +93,7 @@ func TestAlertProvider_buildRequestBody(t *testing.T) {
|
|||||||
scenario.Resolved,
|
scenario.Resolved,
|
||||||
)
|
)
|
||||||
if string(body) != scenario.ExpectedBody {
|
if string(body) != scenario.ExpectedBody {
|
||||||
t.Errorf("expected %s, got %s", scenario.ExpectedBody, body)
|
t.Errorf("expected:\n%s\ngot:\n%s", scenario.ExpectedBody, body)
|
||||||
}
|
}
|
||||||
out := make(map[string]interface{})
|
out := make(map[string]interface{})
|
||||||
if err := json.Unmarshal(body, &out); err != nil {
|
if err := json.Unmarshal(body, &out); err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user