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

Function Test_executeOnPreShutdownHooks_Error

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

Source from the content-addressed store, hash-verified

680}
681
682func Test_executeOnPreShutdownHooks_Error(t *testing.T) {
683 t.Parallel()
684 app := New()
685
686 app.Hooks().OnPreShutdown(func() error {
687 return errors.New("pre error")
688 })
689
690 var buf bytes.Buffer
691 log.SetOutput(&buf)
692 app.hooks.executeOnPreShutdownHooks()
693 require.NotZero(t, buf.Len())
694}
695
696func Test_executeOnForkHooks_Error(t *testing.T) {
697 t.Parallel()

Callers

nothing calls this directly

Calls 7

LenMethod · 0.95
SetOutputFunction · 0.92
OnPreShutdownMethod · 0.80
HooksMethod · 0.80
NewFunction · 0.70
NewMethod · 0.65

Tested by

no test coverage detected