Пример #1
0
func TestMain(m *testing.M) {
	utils.LoadEnv("../.env_test")
	utils.InitLogger()
	InitDB()
	retCode := m.Run()
	os.Exit(retCode)
}
Пример #2
0
	. "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()
})
Пример #3
0
func initMain() {
	utils.LoadEnv(".env")
	utils.InitLogger()
	models.InitDB()
}