|
|
|
|
@ -10,11 +10,9 @@ vi.mock("../config.js", () => ({
|
|
|
|
|
loadConfig: vi.fn().mockReturnValue({}),
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
|
|
type StoreModule = typeof import("./store.js");
|
|
|
|
|
import { loadConfig } from "../config.js";
|
|
|
|
|
import { clearSessionStoreCacheForTest, loadSessionStore, saveSessionStore } from "./store.js";
|
|
|
|
|
|
|
|
|
|
let clearSessionStoreCacheForTest: StoreModule["clearSessionStoreCacheForTest"];
|
|
|
|
|
let loadSessionStore: StoreModule["loadSessionStore"];
|
|
|
|
|
let saveSessionStore: StoreModule["saveSessionStore"];
|
|
|
|
|
let mockLoadConfig: ReturnType<typeof vi.fn>;
|
|
|
|
|
|
|
|
|
|
const DAY_MS = 24 * 60 * 60 * 1000;
|
|
|
|
|
@ -81,10 +79,6 @@ describe("Integration: saveSessionStore with pruning", () => {
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
beforeEach(async () => {
|
|
|
|
|
vi.resetModules();
|
|
|
|
|
({ clearSessionStoreCacheForTest, loadSessionStore, saveSessionStore } =
|
|
|
|
|
await import("./store.js"));
|
|
|
|
|
const { loadConfig } = await import("../config.js");
|
|
|
|
|
mockLoadConfig = vi.mocked(loadConfig) as ReturnType<typeof vi.fn>;
|
|
|
|
|
testDir = await createCaseDir("pruning-integ");
|
|
|
|
|
storePath = path.join(testDir, "sessions.json");
|
|
|
|
|
|