travaux
This commit is contained in:
parent
8271f37af6
commit
0a5fc21b69
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,2 +1,4 @@
|
|||||||
/frontend/node_modules/
|
/frontend/node_modules/
|
||||||
/frontend/dist/
|
/frontend/dist/
|
||||||
|
clortho.db
|
||||||
|
clortho
|
||||||
|
|||||||
@ -16,19 +16,18 @@ import (
|
|||||||
|
|
||||||
func TestMain(m *testing.M) {
|
func TestMain(m *testing.M) {
|
||||||
// Set up test database file
|
// Set up test database file
|
||||||
os.Setenv("CLORTHO_DB_FILE", "test_clortho.db")
|
os.Setenv("CLORTHO_DB_FILE", "clortho_test.db")
|
||||||
// Global setup
|
// Global setup
|
||||||
fmt.Println("Setting up resources...")
|
fmt.Println("Setting up resources...")
|
||||||
|
|
||||||
db.InitDb()
|
db.InitDb()
|
||||||
|
defer db.ResetDb()
|
||||||
|
|
||||||
exitCode := m.Run() // Run all tests
|
exitCode := m.Run() // Run all tests
|
||||||
|
|
||||||
// Global teardown
|
// Global teardown
|
||||||
fmt.Println("Cleaning up resources...")
|
fmt.Println("Cleaning up resources...")
|
||||||
|
|
||||||
db.ResetDb()
|
|
||||||
|
|
||||||
os.Exit(exitCode)
|
os.Exit(exitCode)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -8,8 +8,8 @@ import (
|
|||||||
// Test to check if all expected tables exist in the database
|
// Test to check if all expected tables exist in the database
|
||||||
func TestTablesExist(t *testing.T) {
|
func TestTablesExist(t *testing.T) {
|
||||||
// Set up test database file
|
// Set up test database file
|
||||||
os.Setenv("CLORTHO_DB_FILE", "test_clortho.db")
|
os.Setenv("CLORTHO_DB_FILE", "clortho_test.db")
|
||||||
defer os.Remove("test_clortho.db") // Cleanup after test
|
defer os.Remove("clortho_test.db") // Cleanup after test
|
||||||
|
|
||||||
// Initialize database
|
// Initialize database
|
||||||
err := InitDb()
|
err := InitDb()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user