app/main_test.go

36 lines
611 B
Go
Raw Normal View History

2021-12-17 07:52:32 +00:00
package app
2021-12-16 04:11:33 +00:00
import (
2021-12-17 07:52:32 +00:00
"testing"
2021-12-16 04:11:33 +00:00
"kumoly.io/kumoly/app/auth"
2021-12-17 07:52:32 +00:00
"kumoly.io/kumoly/app/control"
2021-12-17 04:54:03 +00:00
"kumoly.io/kumoly/app/email"
2021-12-16 13:43:56 +00:00
"kumoly.io/kumoly/app/history"
2021-12-16 04:11:33 +00:00
"kumoly.io/kumoly/app/server"
"kumoly.io/kumoly/app/store"
"kumoly.io/kumoly/app/system"
"kumoly.io/kumoly/app/task"
)
2021-12-17 07:52:32 +00:00
func TestMain(t *testing.T) {
2021-12-16 04:11:33 +00:00
store.Setup()
sys := system.New()
server := server.New("app")
auth.Setup()
auth.SetDB(store.DB)
sys.Inject(auth.Injector(server.API))
2021-12-17 04:54:03 +00:00
sys.Append(server, auth.New(server),
2021-12-17 07:52:32 +00:00
&task.Service{},
&history.Service{},
&email.Service{},
&control.Service{},
)
2021-12-17 04:54:03 +00:00
go sys.Start()
<-sys.Done()
2021-12-16 04:11:33 +00:00
}