task_tracker/test/main_test.go
2019-02-16 14:46:38 -05:00

31 lines
538 B
Go

package test
import (
"github.com/simon987/task_tracker/api"
"github.com/simon987/task_tracker/config"
"net/http"
"testing"
"time"
)
var testApi *api.WebAPI
var testAdminCtx *http.Client
var testUserCtx *http.Client
func TestMain(m *testing.M) {
config.SetupConfig()
testApi = api.New()
testApi.SetupLogger()
testApi.Database.Reset()
go testApi.Run()
time.Sleep(time.Millisecond * 100)
testAdminCtx = getSessionCtx("testadmin", "testadmin", true)
testUserCtx = getSessionCtx("testuser", "testuser", false)
m.Run()
}