(t *testing.T)
| 280 | } |
| 281 | |
| 282 | func Test_App_ErrorHandler_GroupMountRootLevel(t *testing.T) { |
| 283 | t.Parallel() |
| 284 | micro := New(Config{ |
| 285 | ErrorHandler: func(c Ctx, err error) error { |
| 286 | require.Equal(t, "0: GET error", err.Error()) |
| 287 | return c.Status(500).SendString("1: custom error") |
| 288 | }, |
| 289 | }) |
| 290 | micro.Get("/john/doe", func(_ Ctx) error { |
| 291 | return errors.New("0: GET error") |
| 292 | }) |
| 293 | |
| 294 | app := New() |
| 295 | v1 := app.Group("/v1") |
| 296 | v1.Use("/", micro) |
| 297 | |
| 298 | resp, err := app.Test(httptest.NewRequest(MethodGet, "/v1/john/doe", http.NoBody)) |
| 299 | testErrorResponse(t, err, resp, "1: custom error") |
| 300 | } |
| 301 | |
| 302 | // go test -run Test_App_Group_Mount |
| 303 | func Test_App_Group_Mount(t *testing.T) { |
nothing calls this directly
no test coverage detected