Closed shambel-amare closed 10 months ago
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment. Otherwise, this will be closed in 7 days.
This issue was closed because it has been stalled for 30+7 days with no activity.
Description
Description
the issue raises when i am testing endpoints that is in a grouping, working code:
app = buffalo.New(buffalo.Options{ Env: ENV, SessionStore: sessions.Null{}, PreWares: []buffalo.PreWare{ cors.Default().Handler, }, SessionName: "_uloapi_session", Logger: dl, }) app.GET("/health", HealthHandler)
test code: ` type ActionSuite struct { suite.Action } // health test func Test_ActionSuite(t testing.T) { envy.Load("../.env") envy.Set("GO_ENV", "test") app := App() app.Env = "test" action := suite.NewAction(app) //if err != nil { // t.Fatal(err) //}}
func (as *ActionSuite) Test_HealthHandler() { envy.Set("GOENV", "test") tests := []struct { name string body healthResponse }{ { name: "empty", body: healthResponse{}, }, } for , test := range tests { as.Run(test.name, func() {
} the above test passes `
Expected Behavior
modified working code(working from postman):
app = buffalo.New(buffalo.Options{ Env: ENV, SessionStore: sessions.Null{}, PreWares: []buffalo.PreWare{ cors.Default().Handler, }, SessionName: "_uloapi_session", Logger: dl, }) app.GET("/", HomeHandler) // changes to group api:=app.Group("/v1") api.GET("/health", HealthHandler)
test code: ` type ActionSuite struct { suite.Action } // health test func Test_ActionSuite(t testing.T) { envy.Load("../.env") envy.Set("GO_ENV", "test") app := App() app.Env = "test" action := suite.NewAction(app) //if err != nil { // t.Fatal(err) //}}
func (as *ActionSuite) Test_HealthHandler() { envy.Set("GOENV", "test") tests := []struct { name string body healthResponse }{ { name: "empty", body: healthResponse{}, }, } for , test := range tests { as.Run(test.name, func() {
} the above test is expected to pass
Actual Behavior
error: missing port in address
To Reproduce
No response
Additional Context
Details