feat: add test for user store (#1438)

This commit is contained in:
boojack
2023-04-01 22:47:19 +08:00
committed by GitHub
parent 0cddb358c1
commit 0baf6b0e19
5 changed files with 101 additions and 8 deletions

22
test/test.go Normal file
View File

@@ -0,0 +1,22 @@
package test
import (
"fmt"
"testing"
"github.com/usememos/memos/server/profile"
"github.com/usememos/memos/server/version"
)
func GetTestingProfile(t *testing.T) *profile.Profile {
// Get a temporary directory for the test data.
dir := t.TempDir()
mode := "prod"
return &profile.Profile{
Mode: mode,
Port: 8082,
Data: dir,
DSN: fmt.Sprintf("%s/memos_%s.db", dir, mode),
Version: version.GetCurrentVersion(mode),
}
}