(tb testing.TB)
| 71 | } |
| 72 | |
| 73 | func createHelperServer(tb testing.TB) (app *fiber.App, dial func(addr string) (net.Conn, error), start func()) { //nolint:nonamedreturns // gocritic unnamedResult requires explicit result identifiers for helper components |
| 74 | tb.Helper() |
| 75 | |
| 76 | ln := fasthttputil.NewInmemoryListener() |
| 77 | |
| 78 | app = fiber.New() |
| 79 | |
| 80 | dial = func(_ string) (net.Conn, error) { |
| 81 | return ln.Dial() |
| 82 | } |
| 83 | start = func() { |
| 84 | require.NoError(tb, app.Listener(ln, fiber.ListenConfig{DisableStartupMessage: true})) |
| 85 | } |
| 86 | |
| 87 | return app, dial, start |
| 88 | } |
| 89 | |
| 90 | func testRequest(t *testing.T, handler fiber.Handler, wrapAgent func(agent *Request), excepted string, count ...int) { |
| 91 | t.Helper() |
no test coverage detected