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

Function Test_executeOnForkHooks_Error

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

Source from the content-addressed store, hash-verified

694}
695
696func Test_executeOnForkHooks_Error(t *testing.T) {
697 t.Parallel()
698 app := New()
699
700 app.Hooks().OnFork(func(pid int) error {
701 require.Equal(t, 1, pid)
702 return errors.New("fork error")
703 })
704
705 var buf bytes.Buffer
706 log.SetOutput(&buf)
707 app.hooks.executeOnForkHooks(1)
708 require.NotZero(t, buf.Len())
709}
710
711func Test_executeOnMountHooks_Error(t *testing.T) {
712 t.Parallel()

Callers

nothing calls this directly

Calls 7

LenMethod · 0.95
SetOutputFunction · 0.92
OnForkMethod · 0.80
HooksMethod · 0.80
executeOnForkHooksMethod · 0.80
NewFunction · 0.70
NewMethod · 0.65

Tested by

no test coverage detected