MCPcopy
hub / github.com/gofiber/fiber / Test_App_Deep_Group

Function Test_App_Deep_Group

app_test.go:1930–1948  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1928}
1929
1930func Test_App_Deep_Group(t *testing.T) {
1931 t.Parallel()
1932 runThroughCount := 0
1933 dummyHandler := func(c Ctx) error {
1934 runThroughCount++
1935 return c.Next()
1936 }
1937
1938 app := New()
1939 gAPI := app.Group("/api", dummyHandler)
1940 gV1 := gAPI.Group("/v1", dummyHandler)
1941 gUser := gV1.Group("/user", dummyHandler)
1942 gUser.Get("/authenticate", func(c Ctx) error {
1943 runThroughCount++
1944 return c.SendStatus(200)
1945 })
1946 testStatus200(t, app, "/api/v1/user/authenticate", MethodGet)
1947 require.Equal(t, 4, runThroughCount, "Loop count")
1948}
1949
1950// go test -run Test_App_Next_Method
1951func Test_App_Next_Method(t *testing.T) {

Callers

nothing calls this directly

Calls 6

testStatus200Function · 0.85
NewFunction · 0.70
NextMethod · 0.65
GroupMethod · 0.65
GetMethod · 0.65
SendStatusMethod · 0.65

Tested by

no test coverage detected