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

Function Test_Hook_OnRoute_Mount

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

Source from the content-addressed store, hash-verified

41}
42
43func Test_Hook_OnRoute_Mount(t *testing.T) {
44 t.Parallel()
45 app := New()
46 subApp := New()
47 app.Use("/sub", subApp)
48
49 subApp.Hooks().OnRoute(func(r Route) error {
50 require.Equal(t, "/sub/test", r.Path)
51
52 return nil
53 })
54
55 app.Hooks().OnRoute(func(r Route) error {
56 require.Equal(t, "/", r.Path)
57
58 return nil
59 })
60
61 app.Get("/", testSimpleHandler).Name("x")
62 subApp.Get("/test", testSimpleHandler)
63}
64
65func Test_Hook_OnName(t *testing.T) {
66 t.Parallel()

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…