mirror of https://github.com/openclaw/openclaw.git
test(telegram): normalize message-context timing inputs
This commit is contained in:
parent
415e7d941b
commit
e6441760d2
|
|
@ -45,6 +45,7 @@ export async function buildTelegramMessageContextForTest(
|
|||
},
|
||||
} as never,
|
||||
cfg: (params.cfg ?? baseTelegramMessageContextConfig) as never,
|
||||
loadFreshConfig: () => (params.cfg ?? baseTelegramMessageContextConfig) as never,
|
||||
account: { accountId: params.accountId ?? "default" } as never,
|
||||
historyLimit: 0,
|
||||
groupHistories: new Map(),
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import { beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { buildTelegramMessageContextForTest } from "./bot-message-context.test-harness.js";
|
||||
|
||||
const recordInboundSessionMock = vi.hoisted(() => vi.fn().mockResolvedValue(undefined));
|
||||
const resolveTelegramConversationRouteMock = vi.hoisted(() => vi.fn());
|
||||
|
|
@ -19,8 +20,6 @@ vi.mock("./conversation-route.js", async (importOriginal) => {
|
|||
};
|
||||
});
|
||||
|
||||
let buildTelegramMessageContextForTest: typeof import("./bot-message-context.test-harness.js").buildTelegramMessageContextForTest;
|
||||
|
||||
function createBoundRoute(params: { accountId: string; sessionKey: string; agentId: string }) {
|
||||
return {
|
||||
configuredBinding: null,
|
||||
|
|
@ -38,12 +37,6 @@ function createBoundRoute(params: { accountId: string; sessionKey: string; agent
|
|||
}
|
||||
|
||||
describe("buildTelegramMessageContext thread binding override", () => {
|
||||
beforeAll(async () => {
|
||||
vi.resetModules();
|
||||
({ buildTelegramMessageContextForTest } =
|
||||
await import("./bot-message-context.test-harness.js"));
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
recordInboundSessionMock.mockClear();
|
||||
resolveTelegramConversationRouteMock.mockReset();
|
||||
|
|
|
|||
|
|
@ -433,7 +433,7 @@
|
|||
"durationMs": 20
|
||||
},
|
||||
"extensions/telegram/src/bot-message-context.implicit-mention.test.ts": {
|
||||
"durationMs": 20
|
||||
"durationMs": 13300
|
||||
},
|
||||
"extensions/telegram/src/action-runtime.test.ts": {
|
||||
"durationMs": 19
|
||||
|
|
|
|||
Loading…
Reference in New Issue