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

Function Test_Hook_OnGroup_Mount

hooks_test.go:122–137  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

120}
121
122func Test_Hook_OnGroup_Mount(t *testing.T) {
123 t.Parallel()
124 app := New()
125 micro := New()
126 micro.Use("/john", app)
127
128 app.Hooks().OnGroup(func(g Group) error {
129 require.Equal(t, "/john/v1", g.Prefix)
130 return nil
131 })
132
133 v1 := app.Group("/v1")
134 v1.Get("/doe", func(c Ctx) error {
135 return c.SendStatus(StatusOK)
136 })
137}
138
139func Test_Hook_OnGroupName(t *testing.T) {
140 t.Parallel()

Callers

nothing calls this directly

Calls 7

OnGroupMethod · 0.80
HooksMethod · 0.80
NewFunction · 0.70
UseMethod · 0.65
GroupMethod · 0.65
GetMethod · 0.65
SendStatusMethod · 0.65

Tested by

no test coverage detected