Пример #1
0
	. "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()
})

var _ = AfterEach(func() {
Пример #2
0
func initMain() {
	utils.LoadEnv(".env")
	utils.InitLogger()
	models.InitDB()
}