mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 19:14:33 +00:00
test: group remaining suite cleanups
This commit is contained in:
@@ -10,6 +10,8 @@ import type { SessionEntry } from "./types.js";
|
||||
vi.mock("../config.js", () => ({
|
||||
loadConfig: vi.fn().mockReturnValue({}),
|
||||
}));
|
||||
const { loadConfig } = await import("../config.js");
|
||||
const mockLoadConfig = vi.mocked(loadConfig) as ReturnType<typeof vi.fn>;
|
||||
|
||||
const DAY_MS = 24 * 60 * 60 * 1000;
|
||||
|
||||
@@ -45,7 +47,6 @@ describe("Integration: saveSessionStore with pruning", () => {
|
||||
let testDir: string;
|
||||
let storePath: string;
|
||||
let savedCacheTtl: string | undefined;
|
||||
let mockLoadConfig: ReturnType<typeof vi.fn>;
|
||||
|
||||
beforeAll(async () => {
|
||||
fixtureRoot = await fs.mkdtemp(path.join(os.tmpdir(), "openclaw-pruning-integ-"));
|
||||
@@ -61,9 +62,7 @@ describe("Integration: saveSessionStore with pruning", () => {
|
||||
savedCacheTtl = process.env.OPENCLAW_SESSION_CACHE_TTL_MS;
|
||||
process.env.OPENCLAW_SESSION_CACHE_TTL_MS = "0";
|
||||
clearSessionStoreCacheForTest();
|
||||
|
||||
const configModule = await import("../config.js");
|
||||
mockLoadConfig = configModule.loadConfig as ReturnType<typeof vi.fn>;
|
||||
mockLoadConfig.mockReset();
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
|
||||
Reference in New Issue
Block a user