Files
oh-my-pi/packages/coding-agent/test/memory-backend-resolve.test.ts
T
2026-05-12 04:09:33 +02:00

21 lines
816 B
TypeScript

import { afterEach, beforeEach, describe, expect, it } from "bun:test";
import { _resetSettingsForTest, Settings } from "@oh-my-pi/pi-coding-agent/config/settings";
import { resolveMemoryBackend } from "@oh-my-pi/pi-coding-agent/memory-backend";
describe("resolveMemoryBackend", () => {
beforeEach(() => {
_resetSettingsForTest();
});
afterEach(() => {
_resetSettingsForTest();
});
it("returns the hindsight backend when memory.backend is hindsight, regardless of legacy memories.enabled", () => {
const a = Settings.isolated({ "memory.backend": "hindsight", "memories.enabled": false });
const b = Settings.isolated({ "memory.backend": "hindsight", "memories.enabled": true });
expect(resolveMemoryBackend(a).id).toBe("hindsight");
expect(resolveMemoryBackend(b).id).toBe("hindsight");
});
});