Skip to content

armgit / memos

Public Imported from GitHub
0

Memos is an open-source, self-hosted note-taking app that brings your everyday thoughts together in a personal timeline. Your data stays yours, and you choose what to keep private or share.

chore: fix tests

Stevenedcddf3c9548
diff --git a/server/router/api/v1/test/test_helper.go b/server/router/api/v1/test/test_helper.go
index 53024d29b..fabfaf0db 100644
--- a/server/router/api/v1/test/test_helper.go
+++ b/server/router/api/v1/test/test_helper.go
@@ -48,6 +48,9 @@ func NewTestService(t *testing.T) *TestService {
MarkdownService: markdownService,
}
+ // Clear any cached state from previous tests
+ service.ClearInstanceOwnerCache()
+
return &TestService{
Service: service,
Store: testStore,
@@ -58,8 +61,8 @@ func NewTestService(t *testing.T) *TestService {
// Cleanup clears caches and closes resources after test.
func (ts *TestService) Cleanup() {
+ ts.Service.ClearInstanceOwnerCache()
ts.Store.Close()
- // Note: Owner cache is package-level in parent package, cannot clear from test package
}
// CreateHostUser creates an admin user for testing.