mirror of
https://github.com/Floriansylvain/RenewCMS.git
synced 2026-08-19 19:53:21 +02:00
fix: set "DB_FILE" environment variable in tests
This commit adds a line to set the "DB_FILE" environment variable in tests. This ensures that tests are always using "test.db" for database related operations, aligning testing environment accurately which guarantees consistent results.
This commit is contained in:
@@ -31,6 +31,7 @@ func StartServerIfNotAlready() {
|
||||
return
|
||||
}
|
||||
_ = os.Remove("test.db")
|
||||
_ = os.Setenv("DB_FILE", "test.db")
|
||||
go func(url *string) {
|
||||
router := server.InitServer()
|
||||
*url = "http://localhost:" + os.Getenv("PORT") + "/v1"
|
||||
|
||||
Reference in New Issue
Block a user