mirror of
https://github.com/simon987/task_tracker.git
synced 2025-04-20 10:36:46 +00:00
31 lines
538 B
Go
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()
|
|
}
|