Closed
Description
Is your feature request related to a problem?
No
Describe the solution you'd like
httpexpect already supports fasthttp binder.
The only thing to do is making app.handler
accessable.
Simple example:
// fiberHTTPTester returns a new Expect instance to test FiberHandler().
func fiberHTTPTester(t *testing.T) *httpexpect.Expect {
app := fiber.New()
app.Get("ping", func(c *fiber.Ctx) {
c.SendString("pong")
})
return httpexpect.WithConfig(httpexpect.Config{
Client: &http.Client{Transport: httpexpect.NewFastBinder(app.Handler)},
Reporter: t,
})
}
func TestFastHTTP(t *testing.T) {
e := fiberHTTPTester(t)
e.GET("/ping").Expect().
Status(200).
Text().Equal("pong")
}