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

Function Test_Hook_OnName_Error

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

Source from the content-addressed store, hash-verified

88}
89
90func Test_Hook_OnName_Error(t *testing.T) {
91 t.Parallel()
92 app := New()
93
94 app.Hooks().OnName(func(_ Route) error {
95 return errors.New("unknown error")
96 })
97
98 require.PanicsWithError(t, "unknown error", func() {
99 app.Get("/", testSimpleHandler).Name("index")
100 })
101}
102
103func Test_Hook_OnGroup(t *testing.T) {
104 t.Parallel()

Callers

nothing calls this directly

Calls 6

OnNameMethod · 0.80
HooksMethod · 0.80
NewFunction · 0.70
NewMethod · 0.65
NameMethod · 0.65
GetMethod · 0.65

Tested by

no test coverage detected