style(memory): format flaky ci test files

This commit is contained in:
Peter Steinberger
2026-02-16 05:32:35 +01:00
parent 794808b169
commit ceddb4a593
2 changed files with 18 additions and 6 deletions

View File

@@ -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);

View File

@@ -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();