Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

test: add missing test files for tauri commands and memory utilities

Steven Enamakel0bf6bb5eb0b8
diff --git a/app/src/utils/__tests__/tauriCommandsMemory.test.ts b/app/src/utils/__tests__/tauriCommandsMemory.test.ts
index 7fa60dff3b..47d0d1dbc4 100644
--- a/app/src/utils/__tests__/tauriCommandsMemory.test.ts
+++ b/app/src/utils/__tests__/tauriCommandsMemory.test.ts
@@ -27,6 +27,7 @@ describe('memoryGraphQuery', () => {
mockIsTauri.mockReturnValue(false);
mockCallCoreRpc.mockResolvedValue([]);
await memoryGraphQuery();
+ expect(mockCallCoreRpc).toHaveBeenCalled();
});
it('calls core RPC with memory.graph.query method and optional params', async () => {
@@ -74,6 +75,7 @@ describe('memoryDocIngest', () => {
mockIsTauri.mockReturnValue(false);
mockCallCoreRpc.mockResolvedValue([]);
await memoryDocIngest({ namespace: 'ns', key: 'k', title: 't', content: 'c' });
+ expect(mockCallCoreRpc).toHaveBeenCalled();
});
it('calls core RPC with memory.doc.ingest and forwards all params', async () => {
diff --git a/app/src/utils/tauriCommands/__tests__/config.test.ts b/app/src/utils/tauriCommands/__tests__/config.test.ts
index cc57f0f905..d4fd87d625 100644
--- a/app/src/utils/tauriCommands/__tests__/config.test.ts
+++ b/app/src/utils/tauriCommands/__tests__/config.test.ts
@@ -26,6 +26,7 @@ describe('openhumanGetClientConfig', () => {
vi.mocked(isTauri).mockReturnValueOnce(false);
vi.mocked(callCoreRpc).mockResolvedValueOnce({} as never);
await openhumanGetClientConfig();
+ expect(vi.mocked(callCoreRpc)).toHaveBeenCalled();
});
it('dispatches openhuman.inference_get_client_config and returns the response', async () => {
@@ -93,5 +94,6 @@ describe('Claude Code wrappers', () => {
vi.mocked(isTauri).mockReturnValueOnce(false);
vi.mocked(callCoreRpc).mockResolvedValueOnce({} as never);
await call();
+ expect(vi.mocked(callCoreRpc)).toHaveBeenCalled();
});
});
diff --git a/app/src/utils/tauriCommands/__tests__/migrateHermes.test.ts b/app/src/utils/tauriCommands/__tests__/migrateHermes.test.ts
index 955c987459..57aae363c1 100644
--- a/app/src/utils/tauriCommands/__tests__/migrateHermes.test.ts
+++ b/app/src/utils/tauriCommands/__tests__/migrateHermes.test.ts
@@ -1,9 +1,19 @@
-import { describe, expect, it } from 'vitest';
+import { describe, expect, it, vi } from 'vitest';
+import { callCoreRpc } from '../../../services/coreRpcClient';
import { openhumanMigrateHermes } from '../core';
+vi.mock('../../../services/coreRpcClient', () => ({
+ callCoreRpc: vi.fn(),
+ clearCoreRpcTokenCache: vi.fn(),
+}));
+
describe('openhumanMigrateHermes', () => {
- it('throws when not running in Tauri', async () => {
- await expect(openhumanMigrateHermes()).rejects.toThrow('Not running in Tauri');
+ it('calls core RPC without requiring the Tauri shell', async () => {
+ vi.mocked(callCoreRpc).mockResolvedValueOnce({ result: {}, logs: [] } as never);
+ await openhumanMigrateHermes();
+ expect(callCoreRpc).toHaveBeenCalledWith(
+ expect.objectContaining({ method: expect.stringContaining('hermes') })
+ );
});
});
diff --git a/app/src/utils/tauriCommands/memory.test.ts b/app/src/utils/tauriCommands/memory.test.ts
index b981a6d7ec..e242632b30 100644
--- a/app/src/utils/tauriCommands/memory.test.ts
+++ b/app/src/utils/tauriCommands/memory.test.ts
@@ -45,6 +45,7 @@ describe('memorySyncAll', () => {
mockIsTauri.mockReturnValue(false);
mockCallCoreRpc.mockResolvedValue({});
await memorySyncAll();
+ expect(mockCallCoreRpc).toHaveBeenCalled();
});
test('calls memory_sync_all and returns result', async () => {
@@ -62,6 +63,7 @@ describe('memoryLearnAll', () => {
mockIsTauri.mockReturnValue(false);
mockCallCoreRpc.mockResolvedValue({});
await memoryLearnAll();
+ expect(mockCallCoreRpc).toHaveBeenCalled();
});
test('calls memory_learn_all without namespaces param when none provided', async () => {
@@ -152,5 +154,6 @@ describe('aiListMemoryFiles', () => {
mockIsTauri.mockReturnValue(false);
mockCallCoreRpc.mockResolvedValue({});
await aiListMemoryFiles();
+ expect(mockCallCoreRpc).toHaveBeenCalled();
});
});