//go:build test

package db

import (
	"os"
	"testing"

	"crussell/testutils/testdb"
)

func TestMain(m *testing.M) {
	pool := testdb.CreateTestDatabase(testDBName)
	pool.Close() // db.Connect() creates its own pool
	resetEnv()
	code := m.Run()
	closePool()
	testdb.DestroyTestDatabase(nil, testDBName)
	os.Exit(code)
}
