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

31 lines
503 B
Go

//go:build test && dev
// +build test,dev
package bookings
import (
"os"
"testing"
"crussell/db"
"crussell/handlers/payments"
"crussell/internal/square"
"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()
square.Client = square.NewDevClient()
payments.SquareClient = square.Client
code := m.Run()
pool.Close()
os.Exit(code)
}