mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-15 19:21:08 +00:00
fix(ci): refresh memory-wiki test typings
This commit is contained in:
@@ -4,6 +4,7 @@ import path from "node:path";
|
||||
import { Command } from "commander";
|
||||
import { afterAll, afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { registerWikiCli } from "./cli.js";
|
||||
import type { MemoryWikiPluginConfig } from "./config.js";
|
||||
import { parseWikiMarkdown, renderWikiMarkdown } from "./markdown.js";
|
||||
import { createMemoryWikiTestHarness } from "./test-helpers.js";
|
||||
|
||||
@@ -35,7 +36,7 @@ describe("memory-wiki cli", () => {
|
||||
});
|
||||
|
||||
async function createCliVault(options?: {
|
||||
config?: Parameters<typeof createVault>[0]["config"];
|
||||
config?: MemoryWikiPluginConfig;
|
||||
initialize?: boolean;
|
||||
}) {
|
||||
return createVault({
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
import type { MemoryWikiMutationInput } from "openclaw/plugin-sdk/memory-wiki";
|
||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { applyMemoryWikiMutation, normalizeMemoryWikiMutationInput } from "./apply.js";
|
||||
import {
|
||||
applyMemoryWikiMutation,
|
||||
normalizeMemoryWikiMutationInput,
|
||||
type ApplyMemoryWikiMutation,
|
||||
} from "./apply.js";
|
||||
import { registerMemoryWikiGatewayMethods } from "./gateway.js";
|
||||
import { ingestMemoryWikiSource } from "./ingest.js";
|
||||
import { searchMemoryWiki } from "./query.js";
|
||||
@@ -69,9 +72,16 @@ describe("memory-wiki gateway methods", () => {
|
||||
beforeEach(() => {
|
||||
vi.clearAllMocks();
|
||||
vi.mocked(syncMemoryWikiImportedSources).mockResolvedValue({
|
||||
importedFiles: [],
|
||||
skippedFiles: [],
|
||||
refreshedIndexes: false,
|
||||
importedCount: 0,
|
||||
updatedCount: 0,
|
||||
skippedCount: 0,
|
||||
removedCount: 0,
|
||||
artifactCount: 0,
|
||||
workspaces: 0,
|
||||
pagePaths: [],
|
||||
indexesRefreshed: false,
|
||||
indexUpdatedFiles: [],
|
||||
indexRefreshReason: "no-import-changes",
|
||||
});
|
||||
vi.mocked(resolveMemoryWikiStatus).mockResolvedValue({
|
||||
vaultMode: "isolated",
|
||||
@@ -85,7 +95,7 @@ describe("memory-wiki gateway methods", () => {
|
||||
title: "Gateway Alpha",
|
||||
body: "Gateway summary.",
|
||||
sourceIds: ["source.alpha"],
|
||||
} satisfies MemoryWikiMutationInput);
|
||||
} satisfies ApplyMemoryWikiMutation);
|
||||
vi.mocked(applyMemoryWikiMutation).mockResolvedValue({
|
||||
operation: "create_synthesis",
|
||||
pagePath: "syntheses/gateway-alpha.md",
|
||||
|
||||
@@ -3,6 +3,7 @@ import os from "node:os";
|
||||
import path from "node:path";
|
||||
import { afterAll, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import type { OpenClawConfig } from "../api.js";
|
||||
import type { MemoryWikiPluginConfig } from "./config.js";
|
||||
import { renderWikiMarkdown } from "./markdown.js";
|
||||
import { getMemoryWikiPage, searchMemoryWiki } from "./query.js";
|
||||
import { createMemoryWikiTestHarness } from "./test-helpers.js";
|
||||
@@ -35,7 +36,7 @@ afterAll(async () => {
|
||||
});
|
||||
|
||||
async function createQueryVault(options?: {
|
||||
config?: Parameters<typeof createVault>[0]["config"];
|
||||
config?: MemoryWikiPluginConfig;
|
||||
initialize?: boolean;
|
||||
}) {
|
||||
return createVault({
|
||||
|
||||
Reference in New Issue
Block a user