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