Test_App_GetRoutes() — fiber Function Reference
Architecture documentation for the Test_App_GetRoutes() function in app_test.go from the fiber codebase.
Entity Profile
Dependency Diagram
graph TD d484106e_fb9f_6640_b984_227749a52681["Test_App_GetRoutes()"] e728fdd2_242f_706b_c1d2_041b3d6badb5["app_test.go"] d484106e_fb9f_6640_b984_227749a52681 -->|defined in| e728fdd2_242f_706b_c1d2_041b3d6badb5 style d484106e_fb9f_6640_b984_227749a52681 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
app_test.go lines 2649–2677
func Test_App_GetRoutes(t *testing.T) {
t.Parallel()
app := New()
app.Use(func(c Ctx) error {
return c.Next()
})
handler := func(c Ctx) error {
return c.SendStatus(StatusOK)
}
app.Delete("/delete", handler).Name("delete")
app.Post("/post", handler).Name("post")
routes := app.GetRoutes(false)
require.Len(t, routes, 2+len(app.config.RequestMethods))
methodMap := map[string]string{"/delete": "delete", "/post": "post"}
for _, route := range routes {
name, ok := methodMap[route.Path]
if ok {
require.Equal(t, name, route.Name)
}
}
routes = app.GetRoutes(true)
require.Len(t, routes, 2)
for _, route := range routes {
name, ok := methodMap[route.Path]
require.True(t, ok)
require.Equal(t, name, route.Name)
}
}
Domain
Subdomains
Defined In
Source
Frequently Asked Questions
What does Test_App_GetRoutes() do?
Test_App_GetRoutes() is a function in the fiber codebase, defined in app_test.go.
Where is Test_App_GetRoutes() defined?
Test_App_GetRoutes() is defined in app_test.go at line 2649.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free