chore: update store testing

This commit is contained in:
Steven
2024-01-10 10:08:53 +08:00
parent 4bc2a0ff42
commit 38cd5fabee
17 changed files with 106 additions and 125 deletions

View File

@ -6,6 +6,8 @@ import (
"os"
"testing"
"github.com/joho/godotenv"
"github.com/yourselfhosted/slash/server/profile"
"github.com/yourselfhosted/slash/server/version"
)
@ -24,6 +26,10 @@ func getUnusedPort() int {
}
func GetTestingProfile(t *testing.T) *profile.Profile {
if err := godotenv.Load(".env"); err != nil {
t.Log("failed to load .env file, but it's ok")
}
// Get a temporary directory for the test data.
dir := t.TempDir()
mode := "dev"