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

Function Test_executeOnNameHooks_ErrorWithMount

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

Source from the content-addressed store, hash-verified

596}
597
598func Test_executeOnNameHooks_ErrorWithMount(t *testing.T) {
599 t.Parallel()
600 app := New()
601 app.mountFields.mountPath = testMountPath
602
603 var received string
604 app.Hooks().OnName(func(r Route) error {
605 received = r.Path
606 return errors.New("name error")
607 })
608
609 err := app.hooks.executeOnNameHooks(&Route{Path: "/bar", path: "/bar"})
610 require.Equal(t, testMountPath+"/bar", received)
611 require.EqualError(t, err, "name error")
612}
613
614func Test_executeOnGroupHooks_ErrorWithMount(t *testing.T) {
615 t.Parallel()

Callers

nothing calls this directly

Calls 5

OnNameMethod · 0.80
HooksMethod · 0.80
executeOnNameHooksMethod · 0.80
NewFunction · 0.70
NewMethod · 0.65

Tested by

no test coverage detected