fix: add listMissions to MissionStore mock to prevent flaky test

The MissionLoop calls this.missionStore.listMissions() during startup
recovery, but the mock TaskStore's getMissionStore() return value didn't
include this method. When the runtime startup sequence raced ahead, it
would hit "listMissions is not a function" — making the test flaky.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Timothy Laurent
2026-05-05 13:55:35 -07:00
parent 8f47e8ddd8
commit b09f7d0602

View File

@@ -57,6 +57,7 @@ vi.mock("@fusion/core", async () => {
self.getTask = mockTaskStoreGetTask;
self.getSettings = vi.fn().mockImplementation(async () => structuredClone(mockTaskStoreSettings));
self.getMissionStore = vi.fn().mockReturnValue({
listMissions: vi.fn().mockReturnValue([]),
getMissionWithHierarchy: vi.fn().mockReturnValue(null),
findNextPendingSlice: vi.fn().mockReturnValue(null),
activateSlice: vi.fn(),