Home / Function/ testClient() — fiber Function Reference

testClient() — fiber Function Reference

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

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

client/helper_test.go lines 141–164

func testClient(t *testing.T, handler fiber.Handler, wrapAgent func(agent *Client), excepted string, count ...int) { //nolint:unparam // maybe needed
	t.Helper()

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

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

	for i := 0; i < c; i++ {
		client := New().SetDial(ln)
		wrapAgent(client)

		resp, err := client.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 testClient() do?
testClient() is a function in the fiber codebase, defined in client/helper_test.go.
Where is testClient() defined?
testClient() is defined in client/helper_test.go at line 141.
What does testClient() call?
testClient() 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