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

Function Test_executeOnGroupNameHooks_ErrorWithMount

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

Source from the content-addressed store, hash-verified

628}
629
630func Test_executeOnGroupNameHooks_ErrorWithMount(t *testing.T) {
631 t.Parallel()
632 app := New()
633 app.mountFields.mountPath = testMountPath
634
635 var prefix string
636 app.Hooks().OnGroupName(func(g Group) error {
637 prefix = g.Prefix
638 return errors.New("group name error")
639 })
640
641 err := app.hooks.executeOnGroupNameHooks(Group{Prefix: "/grp"})
642 require.Equal(t, testMountPath+"/grp", prefix)
643 require.EqualError(t, err, "group name error")
644}
645
646func Test_executeOnListenHooks_Error(t *testing.T) {
647 t.Parallel()

Callers

nothing calls this directly

Calls 5

OnGroupNameMethod · 0.80
HooksMethod · 0.80
NewFunction · 0.70
NewMethod · 0.65

Tested by

no test coverage detected