mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 06:20:43 +00:00
perf(test): mock plugin activation manifest registry
This commit is contained in:
@@ -19,6 +19,22 @@ const loadBundledPluginPublicSurfaceModuleSync = vi.hoisted(() =>
|
||||
}),
|
||||
);
|
||||
|
||||
const loadPluginManifestRegistry = vi.hoisted(() =>
|
||||
vi.fn(() => ({
|
||||
diagnostics: [],
|
||||
plugins: [
|
||||
{
|
||||
channelEnvVars: {
|
||||
discord: ["DISCORD_BOT_TOKEN"],
|
||||
irc: ["IRC_HOST", "IRC_NICK"],
|
||||
slack: ["SLACK_BOT_TOKEN"],
|
||||
telegram: ["TELEGRAM_BOT_TOKEN"],
|
||||
},
|
||||
},
|
||||
],
|
||||
})),
|
||||
);
|
||||
|
||||
const facadeMockHelpers = vi.hoisted(() => {
|
||||
const createLazyFacadeObjectValue = <T extends object>(load: () => T): T =>
|
||||
new Proxy(
|
||||
@@ -38,6 +54,10 @@ const facadeMockHelpers = vi.hoisted(() => {
|
||||
return { createLazyFacadeArrayValue, createLazyFacadeObjectValue };
|
||||
});
|
||||
|
||||
vi.mock("./plugins/manifest-registry.js", () => ({
|
||||
loadPluginManifestRegistry,
|
||||
}));
|
||||
|
||||
vi.mock("./plugin-sdk/facade-loader.js", () => ({
|
||||
...facadeMockHelpers,
|
||||
listImportedBundledPluginFacadeIds: () => [],
|
||||
|
||||
Reference in New Issue
Block a user