fastHTTPTester returns a new Expect instance to test FastHTTPHandler().
(t *testing.T)
| 9 | |
| 10 | // fastHTTPTester returns a new Expect instance to test FastHTTPHandler(). |
| 11 | func 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 | |
| 23 | func TestFastHTTP(t *testing.T) { |
| 24 | e := fastHTTPTester(t) |
no test coverage detected
searching dependent graphs…