Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

address review (gemini): comment why both mocks are needed despite global instances.js mock

[._.]/ Adam Eivy8585cecd8de5
diff --git a/server/routes/pipeline.test.js b/server/routes/pipeline.test.js
index 087b0226f7..ebddfd707d 100644
--- a/server/routes/pipeline.test.js
+++ b/server/routes/pipeline.test.js
@@ -14,7 +14,7 @@ tryReadFile: vi.fn().mockResolvedValue(null),
readJSONFile: vi.fn(async (path, fallback) => (fileStore.has(path) ? fileStore.get(path) : fallback)),
}));
-// Full-replace OK: this route graph doesn't statically import either module.
+// Both mocks needed: vitest.setup.js's global `instances.js` mock uses importOriginal, which leaves the per-file `peerSync.js` mock unable to suppress the createSeries dynamic-import hoist error alone.
vi.mock('../services/instances.js', () => mockNoPeers());
vi.mock('../services/sharing/peerSync.js', () => mockNoPeerSync());
diff --git a/server/routes/universeBuilder.test.js b/server/routes/universeBuilder.test.js
index 32512e96d8..5de7b3a84b 100644
--- a/server/routes/universeBuilder.test.js
+++ b/server/routes/universeBuilder.test.js
@@ -15,7 +15,7 @@ tryReadFile: vi.fn().mockResolvedValue(null),
readJSONFile: vi.fn(async (path, fallback) => (fileStore.has(path) ? fileStore.get(path) : fallback)),
}));
-// Full-replace OK: this route graph doesn't statically import either module.
+// Both mocks needed: vitest.setup.js's global `instances.js` mock uses importOriginal, which leaves the per-file `peerSync.js` mock unable to suppress the createUniverse dynamic-import hoist error alone.
vi.mock('../services/instances.js', () => mockNoPeers());
vi.mock('../services/sharing/peerSync.js', () => mockNoPeerSync());