MCPcopy Create free account
hub / github.com/gavv/httpexpect / fastHTTPTester

Function fastHTTPTester

_examples/fasthttp_test.go:11–21  ·  view source on GitHub ↗

fastHTTPTester returns a new Expect instance to test FastHTTPHandler().

(t *testing.T)

Source from the content-addressed store, hash-verified

9
10// fastHTTPTester returns a new Expect instance to test FastHTTPHandler().
11func fastHTTPTester(t *testing.T) *httpexpect.Expect {
12 return httpexpect.WithConfig(httpexpect.Config{
13 // Pass requests directly to FastHTTPHandler.
14 Client: &http.Client{
15 Transport: httpexpect.NewFastBinder(FastHTTPHandler()),
16 Jar: httpexpect.NewCookieJar(),
17 },
18 // Report errors using testify.
19 Reporter: httpexpect.NewAssertReporter(t),
20 })
21}
22
23func TestFastHTTP(t *testing.T) {
24 e := fastHTTPTester(t)

Callers 1

TestFastHTTPFunction · 0.85

Calls 1

FastHTTPHandlerFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…