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

Function TestToFiberHandler_ExpressTwoParamsWithoutError

adapter_test.go:111–126  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

109}
110
111func TestToFiberHandler_ExpressTwoParamsWithoutError(t *testing.T) {
112 t.Parallel()
113
114 app, ctx := newTestCtx(t)
115
116 handler := func(req Req, res Res) {
117 assert.Equal(t, app, req.App())
118 require.NoError(t, res.SendStatus(http.StatusCreated))
119 }
120
121 converted, ok := toFiberHandler(handler)
122 require.True(t, ok)
123
124 require.NoError(t, converted(ctx))
125 require.Equal(t, http.StatusCreated, ctx.Response().StatusCode())
126}
127
128func TestToFiberHandler_ExpressThreeParamsWithError(t *testing.T) {
129 t.Parallel()

Callers

nothing calls this directly

Calls 6

newTestCtxFunction · 0.85
toFiberHandlerFunction · 0.85
AppMethod · 0.65
SendStatusMethod · 0.65
ResponseMethod · 0.65
StatusCodeMethod · 0.45

Tested by

no test coverage detected