This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
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)
|
||||
}
|
||||
Reference in New Issue
Block a user