Files
kontor/kontor-gin/internal/tests/testutils/db_test_helper.go
T
tpeetz 32f3f034eb
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 3s
add tests for repository
2026-10-06 00:16:03 +02:00

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