Files
Crussell/backend/handlers/user/testmain_test.go
T

27 lines
352 B
Go

//go:build test
// +build test
package user
import (
"os"
"testing"
"crussell/db"
"crussell/testutils/jwt"
"crussell/testutils/testdb"
)
func TestMain(m *testing.M) {
pool, err := testdb.NewPool("")
if err != nil {
panic(err)
}
testdb.Migrate(&testing.T{}, pool)
db.DB = pool
jwt.Init()
code := m.Run()
pool.Close()
os.Exit(code)
}