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

Function Test_executeOnGroupHooks_ErrorWithMount

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

Source from the content-addressed store, hash-verified

612}
613
614func Test_executeOnGroupHooks_ErrorWithMount(t *testing.T) {
615 t.Parallel()
616 app := New()
617 app.mountFields.mountPath = testMountPath
618
619 var prefix string
620 app.Hooks().OnGroup(func(g Group) error {
621 prefix = g.Prefix
622 return errors.New("group error")
623 })
624
625 err := app.hooks.executeOnGroupHooks(Group{Prefix: "/grp"})
626 require.Equal(t, testMountPath+"/grp", prefix)
627 require.EqualError(t, err, "group error")
628}
629
630func Test_executeOnGroupNameHooks_ErrorWithMount(t *testing.T) {
631 t.Parallel()

Callers

nothing calls this directly

Calls 5

OnGroupMethod · 0.80
HooksMethod · 0.80
executeOnGroupHooksMethod · 0.80
NewFunction · 0.70
NewMethod · 0.65

Tested by

no test coverage detected