Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
31 lines
503 B
Go
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)
|
|
}
|