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

Function Test_Hook_OnMount

hooks_test.go:565–580  ·  hooks_test.go::Test_Hook_OnMount
(t *testing.T)

Source from the content-addressed store, hash-verified

563}
564
565func Test_Hook_OnMount(t *testing.T) {
566 t.Parallel()
567 app := New()
568 app.Get("/", testSimpleHandler).Name("x")
569
570 subApp := New()
571 subApp.Get("/test", testSimpleHandler)
572
573 subApp.Hooks().OnMount(func(parent *App) error {
574 require.Empty(t, parent.mountFields.mountPath)
575
576 return nil
577 })
578
579 app.Use("/sub", subApp)
580}
581
582func Test_executeOnRouteHooks_ErrorWithMount(t *testing.T) {
583 t.Parallel()

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected