yao/global/init_test.go
2021-09-29 19:32:22 +08:00

31 lines
481 B
Go

package global
import (
"os"
"path"
"testing"
"github.com/yaoapp/gou"
"github.com/yaoapp/xiang/config"
"github.com/yaoapp/xiang/table"
)
var cfg config.Config
func TestMain(m *testing.M) {
// 加载模型等
Load(Conf)
// 加载表格(临时)
root := "fs://" + path.Join(Conf.Source, "/app/tables/service.json")
table.Load(root, "service").Reload()
// Run test suites
exitVal := m.Run()
// we can do clean up code here
gou.KillPlugins()
os.Exit(exitVal)
}