Home / Function/ testRequest() — fiber Function Reference

testRequest() — fiber Function Reference

Architecture documentation for the testRequest() function in helper_test.go from the fiber codebase.

Entity Profile

Dependency Diagram

graph TD
  e088f968_0f96_0949_b18a_ac2051e0f680["testRequest()"]
  0a463cba_a8ce_ebd2_d862_50fbe27b1d9f["helper_test.go"]
  e088f968_0f96_0949_b18a_ac2051e0f680 -->|defined in| 0a463cba_a8ce_ebd2_d862_50fbe27b1d9f
  4f71862c_f3dd_6c80_0b85_91199487def3["createHelperServer()"]
  e088f968_0f96_0949_b18a_ac2051e0f680 -->|calls| 4f71862c_f3dd_6c80_0b85_91199487def3
  style e088f968_0f96_0949_b18a_ac2051e0f680 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

client/helper_test.go lines 90–115

func testRequest(t *testing.T, handler fiber.Handler, wrapAgent func(agent *Request), excepted string, count ...int) {
	t.Helper()

	app, ln, start := createHelperServer(t)
	app.Get("/", handler)
	go start()

	c := 1
	if len(count) > 0 {
		c = count[0]
	}

	client := New().SetDial(ln)

	for i := 0; i < c; i++ {
		req := AcquireRequest().SetClient(client)
		wrapAgent(req)

		resp, err := req.Get("http://example.com")

		require.NoError(t, err)
		require.Equal(t, fiber.StatusOK, resp.StatusCode())
		require.Equal(t, excepted, resp.String())
		resp.Close()
	}
}

Domain

Subdomains

Frequently Asked Questions

What does testRequest() do?
testRequest() is a function in the fiber codebase, defined in client/helper_test.go.
Where is testRequest() defined?
testRequest() is defined in client/helper_test.go at line 90.
What does testRequest() call?
testRequest() calls 1 function(s): createHelperServer.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free