chore: Fix types in tests 36/N.

This commit is contained in:
cpojer
2026-02-17 15:46:48 +09:00
parent 2a4ca7671e
commit 7b31e8fc59
14 changed files with 86 additions and 42 deletions

View File

@@ -2,11 +2,12 @@ import fs from "node:fs/promises";
import os from "node:os";
import path from "node:path";
import { afterAll, afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
import type { OpenClawConfig } from "../config/config.js";
import { getMemorySearchManager, type MemoryIndexManager } from "./index.js";
import { createOpenAIEmbeddingProviderMock } from "./test-embeddings-mock.js";
import "./test-runtime-mocks.js";
const embedBatch = vi.fn(async () => []);
const embedBatch = vi.fn(async (_texts: string[]) => [] as number[][]);
const embedQuery = vi.fn(async () => [0.5, 0.5, 0.5]);
vi.mock("./embeddings.js", () => ({
@@ -110,7 +111,7 @@ describe("memory indexing with OpenAI batches", () => {
return { fetchMock, state };
}
function createBatchCfg() {
function createBatchCfg(): OpenClawConfig {
return {
agents: {
defaults: {
@@ -126,7 +127,7 @@ describe("memory indexing with OpenAI batches", () => {
},
list: [{ id: "main", default: true }],
},
};
} as OpenClawConfig;
}
beforeAll(async () => {
@@ -141,7 +142,7 @@ describe("memory indexing with OpenAI batches", () => {
if (!result.manager) {
throw new Error("manager missing");
}
manager = result.manager;
manager = result.manager as unknown as MemoryIndexManager;
});
afterAll(async () => {