mirror of
				https://github.com/usememos/memos.git
				synced 2025-10-26 22:36:16 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			22 lines
		
	
	
	
		
			452 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			22 lines
		
	
	
	
		
			452 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| 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),
 | |
| 	}
 | |
| }
 |