mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 15:24:58 +00:00
test(core): use lightweight clears in stable mock setup
This commit is contained in:
@@ -120,9 +120,9 @@ describe("QmdMemoryManager", () => {
|
||||
beforeEach(async () => {
|
||||
spawnMock.mockReset();
|
||||
spawnMock.mockImplementation(() => createMockChild());
|
||||
logWarnMock.mockReset();
|
||||
logDebugMock.mockReset();
|
||||
logInfoMock.mockReset();
|
||||
logWarnMock.mockClear();
|
||||
logDebugMock.mockClear();
|
||||
logInfoMock.mockClear();
|
||||
tmpRoot = path.join(fixtureRoot, `case-${fixtureCount++}`);
|
||||
await fs.mkdir(tmpRoot);
|
||||
workspaceDir = path.join(tmpRoot, "workspace");
|
||||
@@ -1957,7 +1957,7 @@ describe("QmdMemoryManager", () => {
|
||||
await fs.rm(customModelsDir, { recursive: true, force: true });
|
||||
await fs.mkdir(defaultModelsDir, { recursive: true });
|
||||
await fs.writeFile(path.join(defaultModelsDir, "model.bin"), "fake-model");
|
||||
logWarnMock.mockReset();
|
||||
logWarnMock.mockClear();
|
||||
await testCase.setup?.();
|
||||
const { manager } = await createManager({ mode: "full" });
|
||||
expect(manager, testCase.name).toBeTruthy();
|
||||
|
||||
Reference in New Issue
Block a user