mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-04 03:11:40 +00:00
29 lines
1.0 KiB
TypeScript
29 lines
1.0 KiB
TypeScript
/** Test bootstrap shim for Telegram runtime-secret surface coverage. */
|
|
import { vi } from "vitest";
|
|
import { loadChannelSecretContractApi } from "./channel-contract-api.js";
|
|
|
|
/** Test-only bootstrap registry mock for Telegram secret surface tests. */
|
|
const telegramSecrets = loadChannelSecretContractApi({ channelId: "telegram", config: {} });
|
|
if (!telegramSecrets?.collectRuntimeConfigAssignments) {
|
|
throw new Error("Missing Telegram secret contract api");
|
|
}
|
|
const telegramAssignments = telegramSecrets.collectRuntimeConfigAssignments;
|
|
|
|
// Use the real bundled Telegram secret contract while avoiding plugin bootstrap.
|
|
vi.mock("../channels/plugins/bootstrap-registry.js", () => ({
|
|
getBootstrapChannelPlugin: (id: string) =>
|
|
id === "telegram"
|
|
? {
|
|
secrets: {
|
|
collectRuntimeConfigAssignments: telegramAssignments,
|
|
},
|
|
}
|
|
: undefined,
|
|
getBootstrapChannelSecrets: (id: string) =>
|
|
id === "telegram"
|
|
? {
|
|
collectRuntimeConfigAssignments: telegramAssignments,
|
|
}
|
|
: undefined,
|
|
}));
|