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

Function createHelperServer

client/helper_test.go:73–88  ·  view source on GitHub ↗
(tb testing.TB)

Source from the content-addressed store, hash-verified

71}
72
73func 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
90func testRequest(t *testing.T, handler fiber.Handler, wrapAgent func(agent *Request), excepted string, count ...int) {
91 t.Helper()

Callers 15

Test_Client_Invalid_URLFunction · 0.85
Test_ReplaceFunction · 0.85
Test_Client_SetProxyURLFunction · 0.85
Benchmark_Client_RequestFunction · 0.85
testRequestFunction · 0.85
testRequestFailFunction · 0.85
testClientFunction · 0.85
Test_Request_GetFunction · 0.85

Calls 2

ListenerMethod · 0.80
NewMethod · 0.65

Tested by

no test coverage detected