(t *testing.T)
| 356 | } |
| 357 | |
| 358 | func Test_App_UseMountedErrorHandlerRootLevel(t *testing.T) { |
| 359 | t.Parallel() |
| 360 | app := New() |
| 361 | |
| 362 | fiber := New(Config{ |
| 363 | ErrorHandler: func(c Ctx, _ error) error { |
| 364 | return c.Status(500).SendString("hi, i'm a custom error") |
| 365 | }, |
| 366 | }) |
| 367 | fiber.Get("/api", func(_ Ctx) error { |
| 368 | return errors.New("something happened") |
| 369 | }) |
| 370 | |
| 371 | app.Use("/", fiber) |
| 372 | |
| 373 | resp, err := app.Test(httptest.NewRequest(MethodGet, "/api", http.NoBody)) |
| 374 | testErrorResponse(t, err, resp, "hi, i'm a custom error") |
| 375 | } |
| 376 | |
| 377 | func Test_App_UseMountedErrorHandlerForBestPrefixMatch(t *testing.T) { |
| 378 | t.Parallel() |
nothing calls this directly
no test coverage detected