From 60e25cea2f2a0e29ccc946571aac63248ce7f772 Mon Sep 17 00:00:00 2001 From: Florian Sylvain Date: Sun, 13 Aug 2023 21:41:04 +0200 Subject: [PATCH] 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. --- test/utils.go | 1 + 1 file changed, 1 insertion(+) diff --git a/test/utils.go b/test/utils.go index 78b422c..e5b8481 100644 --- a/test/utils.go +++ b/test/utils.go @@ -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"