mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-22 14:41:34 +00:00
test: continue vitest threads migration
This commit is contained in:
@@ -22,7 +22,12 @@ vi.mock("../../agents/agent-scope.js", () => ({
|
||||
listAgentIds: mocks.listAgentIds,
|
||||
}));
|
||||
|
||||
const { resolveSessionKeyForRequest } = await import("./session.js");
|
||||
let resolveSessionKeyForRequest: typeof import("./session.js").resolveSessionKeyForRequest;
|
||||
|
||||
async function loadFreshSessionModuleForTest() {
|
||||
vi.resetModules();
|
||||
({ resolveSessionKeyForRequest } = await import("./session.js"));
|
||||
}
|
||||
|
||||
describe("resolveSessionKeyForRequest", () => {
|
||||
const MAIN_STORE_PATH = "/tmp/main-store.json";
|
||||
@@ -46,7 +51,8 @@ describe("resolveSessionKeyForRequest", () => {
|
||||
mocks.loadSessionStore.mockImplementation((storePath: string) => stores[storePath] ?? {});
|
||||
};
|
||||
|
||||
beforeEach(() => {
|
||||
beforeEach(async () => {
|
||||
await loadFreshSessionModuleForTest();
|
||||
vi.clearAllMocks();
|
||||
mocks.listAgentIds.mockReturnValue(["main"]);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user