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

Function Test_Hook_OnRoute

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

Source from the content-addressed store, hash-verified

23}
24
25func Test_Hook_OnRoute(t *testing.T) {
26 t.Parallel()
27 app := New()
28
29 app.Hooks().OnRoute(func(r Route) error {
30 require.Empty(t, r.Name)
31
32 return nil
33 })
34
35 app.Get("/", testSimpleHandler).Name("x")
36
37 subApp := New()
38 subApp.Get("/test", testSimpleHandler)
39
40 app.Use("/sub", subApp)
41}
42
43func Test_Hook_OnRoute_Mount(t *testing.T) {
44 t.Parallel()

Callers

nothing calls this directly

Calls 6

OnRouteMethod · 0.80
HooksMethod · 0.80
NewFunction · 0.70
NameMethod · 0.65
GetMethod · 0.65
UseMethod · 0.65

Tested by

no test coverage detected