Files
openclaw/src/secrets/runtime-telegram.test-support.ts
2026-04-12 03:59:11 +01:00

25 lines
803 B
TypeScript

import { vi } from "vitest";
import { loadBundledChannelSecretContractApi } from "./channel-contract-api.js";
const telegramSecrets = loadBundledChannelSecretContractApi("telegram");
if (!telegramSecrets?.collectRuntimeConfigAssignments) {
throw new Error("Missing Telegram secret contract api");
}
vi.mock("../channels/plugins/bootstrap-registry.js", () => ({
getBootstrapChannelPlugin: (id: string) =>
id === "telegram"
? {
secrets: {
collectRuntimeConfigAssignments: telegramSecrets.collectRuntimeConfigAssignments,
},
}
: undefined,
getBootstrapChannelSecrets: (id: string) =>
id === "telegram"
? {
collectRuntimeConfigAssignments: telegramSecrets.collectRuntimeConfigAssignments,
}
: undefined,
}));