func TestMain(m *testing.M) { utils.LoadEnv("../.env_test") utils.InitLogger() InitDB() retCode := m.Run() os.Exit(retCode) }
. "github.com/onsi/ginkgo" . "github.com/onsi/gomega" ) var ( ts *httptest.Server ) func TestBlackBox(t *testing.T) { RegisterFailHandler(Fail) RunSpecs(t, "Api WS") } var _ = BeforeSuite(func() { utils.LoadEnv("../.env_test") utils.InitLogger() models.InitDB() ts = httptest.NewServer(handler.NewRouter()) }) var _ = AfterSuite(func() { ts.Close() models.Session.Close() time.Sleep(1 * time.Second) }) var _ = BeforeEach(func() { fmt.Println("----------------------------------------------------------------") cleanDB() })
func initMain() { utils.LoadEnv(".env") utils.InitLogger() models.InitDB() }