//go:build test
// +build test

package user

import (
	"os"
	"testing"

	"crussell/db"
	"crussell/testutils/testdb"
	"crussell/testutils/jwt"
)

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)
}