mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-10 00:31:22 +00:00
test(ci): trim memory cli harness churn
This commit is contained in:
@@ -2,7 +2,7 @@ import fs from "node:fs/promises";
|
||||
import os from "node:os";
|
||||
import path from "node:path";
|
||||
import { Command } from "commander";
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
|
||||
const getMemorySearchManager = vi.hoisted(() => vi.fn());
|
||||
const loadConfig = vi.hoisted(() => vi.fn(() => ({})));
|
||||
@@ -35,17 +35,24 @@ let defaultRuntime: typeof import("../runtime.js").defaultRuntime;
|
||||
let isVerbose: typeof import("../globals.js").isVerbose;
|
||||
let setVerbose: typeof import("../globals.js").setVerbose;
|
||||
|
||||
beforeEach(async () => {
|
||||
vi.resetModules();
|
||||
beforeAll(async () => {
|
||||
({ registerMemoryCli } = await import("./memory-cli.js"));
|
||||
({ defaultRuntime } = await import("../runtime.js"));
|
||||
({ isVerbose, setVerbose } = await import("../globals.js"));
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
getMemorySearchManager.mockReset();
|
||||
loadConfig.mockReset().mockReturnValue({});
|
||||
resolveDefaultAgentId.mockReset().mockReturnValue("main");
|
||||
resolveCommandSecretRefsViaGateway.mockReset().mockImplementation(async ({ config }) => ({
|
||||
resolvedConfig: config,
|
||||
diagnostics: [] as string[],
|
||||
}));
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
vi.restoreAllMocks();
|
||||
getMemorySearchManager.mockClear();
|
||||
resolveCommandSecretRefsViaGateway.mockClear();
|
||||
process.exitCode = undefined;
|
||||
setVerbose(false);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user