(t *testing.T)
| 14 | ) |
| 15 | |
| 16 | func TestDefaultErrorInternal(t *testing.T) { |
| 17 | mode.Set(mode.TestDev) |
| 18 | rec := httptest.NewRecorder() |
| 19 | ctx, _ := gin.CreateTestContext(rec) |
| 20 | ctx.AbortWithError(500, errors.New("something went wrong")) |
| 21 | |
| 22 | Handler()(ctx) |
| 23 | |
| 24 | assertJSONResponse(t, rec, 500, `{"errorCode":500, "errorDescription":"something went wrong", "error":"Internal Server Error"}`) |
| 25 | } |
| 26 | |
| 27 | func TestBindingErrorDefault(t *testing.T) { |
| 28 | mode.Set(mode.TestDev) |
nothing calls this directly
no test coverage detected
searching dependent graphs…