Hi I have written below code to test a gin function
func TestServe(t *testing.T) {
config.SetLoggerConfig(“logger.apipath”)
router := Serve()
w := httptest.NewRecorder()
req, _ := http.NewRequest("GET", "/nodes", nil)
router.ServeHTTP(w, req)
assert.Equal(t, 200, w.Code)
}
Serve() returns a gin Engine , when i run this it gets stuck at
[GIN-debug] Listening and serving HTTP on :8080
how can i overcome this ?