iris/httptest/server.go

19 lines
340 B
Go
Raw Permalink Normal View History

2022-02-25 19:17:02 +01:00
package httptest
import (
"net/http/httptest"
2022-10-22 17:06:18 +02:00
"github.com/kataras/iris/v12"
2022-02-25 19:17:02 +01:00
)
// NewServer is just a helper to create a new standard
// httptest.Server instance.
func NewServer(t IrisTesty, app *iris.Application) *httptest.Server {
2022-02-25 19:17:02 +01:00
if err := app.Build(); err != nil {
t.Fatal(err)
return nil
}
return httptest.NewServer(app)
}