test(msteams): slim messenger runtime fixtures

This commit is contained in:
Vincent Koc
2026-04-03 18:42:59 +09:00
parent b55ac9e64d
commit 5e0decd9b5

View File

@@ -2,7 +2,7 @@ import { mkdtemp, rm, writeFile } from "node:fs/promises";
import os from "node:os";
import path from "node:path";
import { beforeEach, describe, expect, it, vi } from "vitest";
import { createPluginRuntimeMock } from "../../../test/helpers/plugins/plugin-runtime-mock.js";
import { resolvePreferredOpenClawTmpDir } from "../../../src/infra/tmp-openclaw-dir.js";
import { SILENT_REPLY_TOKEN, type PluginRuntime } from "../runtime-api.js";
import type { StoredConversationReference } from "./conversation-store.js";
const graphUploadMockState = vi.hoisted(() => ({
@@ -17,7 +17,6 @@ vi.mock("./graph-upload.js", async () => {
};
});
import { resolvePreferredOpenClawTmpDir } from "openclaw/plugin-sdk/temp-path";
import {
type MSTeamsAdapter,
type MSTeamsRenderedMessage,
@@ -41,7 +40,10 @@ const chunkMarkdownText = (text: string, limit: number) => {
return chunks;
};
const runtimeStub: PluginRuntime = createPluginRuntimeMock({
const runtimeStub = {
config: {
loadConfig: () => ({}),
},
channel: {
text: {
chunkMarkdownText,
@@ -50,7 +52,7 @@ const runtimeStub: PluginRuntime = createPluginRuntimeMock({
convertMarkdownTables: (text: string) => text,
},
},
});
} as unknown as PluginRuntime;
const noopUpdateActivity = async () => {};
const noopDeleteActivity = async () => {};