mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-07 19:01:25 +00:00
style(memory): format flaky ci test files
This commit is contained in:
@@ -96,8 +96,12 @@ describe("resolveMemoryBackendConfig", () => {
|
|||||||
} as OpenClawConfig;
|
} as OpenClawConfig;
|
||||||
const mainResolved = resolveMemoryBackendConfig({ cfg, agentId: "main" });
|
const mainResolved = resolveMemoryBackendConfig({ cfg, agentId: "main" });
|
||||||
const devResolved = resolveMemoryBackendConfig({ cfg, agentId: "dev" });
|
const devResolved = resolveMemoryBackendConfig({ cfg, agentId: "dev" });
|
||||||
const mainNames = new Set((mainResolved.qmd?.collections ?? []).map((collection) => collection.name));
|
const mainNames = new Set(
|
||||||
const devNames = new Set((devResolved.qmd?.collections ?? []).map((collection) => collection.name));
|
(mainResolved.qmd?.collections ?? []).map((collection) => collection.name),
|
||||||
|
);
|
||||||
|
const devNames = new Set(
|
||||||
|
(devResolved.qmd?.collections ?? []).map((collection) => collection.name),
|
||||||
|
);
|
||||||
expect(mainNames.has("memory-dir-main")).toBe(true);
|
expect(mainNames.has("memory-dir-main")).toBe(true);
|
||||||
expect(devNames.has("memory-dir-dev")).toBe(true);
|
expect(devNames.has("memory-dir-dev")).toBe(true);
|
||||||
expect(mainNames.has("workspace-main")).toBe(true);
|
expect(mainNames.has("workspace-main")).toBe(true);
|
||||||
|
|||||||
@@ -321,7 +321,9 @@ describe("QmdMemoryManager", () => {
|
|||||||
emitAndClose(
|
emitAndClose(
|
||||||
child,
|
child,
|
||||||
"stdout",
|
"stdout",
|
||||||
JSON.stringify([{ name: sessionCollectionName, path: wrongSessionsPath, mask: "**/*.md" }]),
|
JSON.stringify([
|
||||||
|
{ name: sessionCollectionName, path: wrongSessionsPath, mask: "**/*.md" },
|
||||||
|
]),
|
||||||
);
|
);
|
||||||
return child;
|
return child;
|
||||||
}
|
}
|
||||||
@@ -340,7 +342,8 @@ describe("QmdMemoryManager", () => {
|
|||||||
|
|
||||||
const commands = spawnMock.mock.calls.map((call) => call[1] as string[]);
|
const commands = spawnMock.mock.calls.map((call) => call[1] as string[]);
|
||||||
const removeSessions = commands.find(
|
const removeSessions = commands.find(
|
||||||
(args) => args[0] === "collection" && args[1] === "remove" && args[2] === sessionCollectionName,
|
(args) =>
|
||||||
|
args[0] === "collection" && args[1] === "remove" && args[2] === sessionCollectionName,
|
||||||
);
|
);
|
||||||
expect(removeSessions).toBeDefined();
|
expect(removeSessions).toBeDefined();
|
||||||
|
|
||||||
@@ -373,7 +376,11 @@ describe("QmdMemoryManager", () => {
|
|||||||
spawnMock.mockImplementation((_cmd: string, args: string[]) => {
|
spawnMock.mockImplementation((_cmd: string, args: string[]) => {
|
||||||
if (args[0] === "collection" && args[1] === "list") {
|
if (args[0] === "collection" && args[1] === "list") {
|
||||||
const child = createMockChild({ autoClose: false });
|
const child = createMockChild({ autoClose: false });
|
||||||
emitAndClose(child, "stdout", JSON.stringify([`workspace-${agentId}`, sessionCollectionName]));
|
emitAndClose(
|
||||||
|
child,
|
||||||
|
"stdout",
|
||||||
|
JSON.stringify([`workspace-${agentId}`, sessionCollectionName]),
|
||||||
|
);
|
||||||
return child;
|
return child;
|
||||||
}
|
}
|
||||||
return createMockChild();
|
return createMockChild();
|
||||||
@@ -384,7 +391,8 @@ describe("QmdMemoryManager", () => {
|
|||||||
|
|
||||||
const commands = spawnMock.mock.calls.map((call) => call[1] as string[]);
|
const commands = spawnMock.mock.calls.map((call) => call[1] as string[]);
|
||||||
const removeSessions = commands.find(
|
const removeSessions = commands.find(
|
||||||
(args) => args[0] === "collection" && args[1] === "remove" && args[2] === sessionCollectionName,
|
(args) =>
|
||||||
|
args[0] === "collection" && args[1] === "remove" && args[2] === sessionCollectionName,
|
||||||
);
|
);
|
||||||
expect(removeSessions).toBeDefined();
|
expect(removeSessions).toBeDefined();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user