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

Function Test_executeOnRouteHooks_ErrorWithMount

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

Source from the content-addressed store, hash-verified

580}
581
582func Test_executeOnRouteHooks_ErrorWithMount(t *testing.T) {
583 t.Parallel()
584 app := New()
585 app.mountFields.mountPath = testMountPath
586
587 var received string
588 app.Hooks().OnRoute(func(r Route) error {
589 received = r.Path
590 return errors.New("hook error")
591 })
592
593 err := app.hooks.executeOnRouteHooks(&Route{Path: "/foo", path: "/foo"})
594 require.Equal(t, testMountPath+"/foo", received)
595 require.EqualError(t, err, "hook error")
596}
597
598func Test_executeOnNameHooks_ErrorWithMount(t *testing.T) {
599 t.Parallel()

Callers

nothing calls this directly

Calls 5

OnRouteMethod · 0.80
HooksMethod · 0.80
executeOnRouteHooksMethod · 0.80
NewFunction · 0.70
NewMethod · 0.65

Tested by

no test coverage detected