38 lines
528 B
Go
38 lines
528 B
Go
package testutils
|
|
|
|
import (
|
|
"os"
|
|
"testing"
|
|
)
|
|
|
|
func SetupTestDatabase() {
|
|
|
|
}
|
|
|
|
func PatchDatabase() {
|
|
|
|
}
|
|
|
|
func TearDownTestDatabase() {
|
|
|
|
}
|
|
|
|
func UnpatchDatabase() {
|
|
|
|
}
|
|
|
|
func InitializeTestSuite(m *testing.M) {
|
|
// Initialize the test database
|
|
SetupTestDatabase()
|
|
// Patch the global database.DB to use the TestDB
|
|
PatchDatabase()
|
|
// Run all tests
|
|
code := m.Run()
|
|
// Teardown the database connection
|
|
TearDownTestDatabase()
|
|
// Unpatch the database
|
|
UnpatchDatabase()
|
|
// Exit with the test run status code
|
|
os.Exit(code)
|
|
}
|