diff --git a/src/secrets/runtime-discord-surface.test.ts b/src/secrets/runtime-discord-surface.test.ts index 9464ae375a4..3f279f5e852 100644 --- a/src/secrets/runtime-discord-surface.test.ts +++ b/src/secrets/runtime-discord-surface.test.ts @@ -1,11 +1,11 @@ import { afterEach, beforeAll, describe, expect, it, vi } from "vitest"; +import * as discordSecrets from "../../extensions/discord/src/secret-config-contract.ts"; import type { AuthProfileStore } from "../agents/auth-profiles.js"; import type { OpenClawConfig } from "../config/config.js"; import { createEmptyPluginRegistry } from "../plugins/registry.js"; import { setActivePluginRegistry } from "../plugins/runtime.js"; -vi.mock("../channels/plugins/bootstrap-registry.js", async () => { - const discordSecrets = await import("../../extensions/discord/src/secret-config-contract.ts"); +vi.mock("../channels/plugins/bootstrap-registry.js", () => { return { getBootstrapChannelPlugin: (id: string) => id === "discord" diff --git a/src/secrets/runtime-inactive-telegram-surfaces.test.ts b/src/secrets/runtime-inactive-telegram-surfaces.test.ts index 32c28e20a6f..8d8b63bef9f 100644 --- a/src/secrets/runtime-inactive-telegram-surfaces.test.ts +++ b/src/secrets/runtime-inactive-telegram-surfaces.test.ts @@ -1,10 +1,10 @@ import { afterEach, beforeAll, describe, expect, it, vi } from "vitest"; +import * as telegramSecrets from "../../extensions/telegram/src/secret-contract.ts"; import type { OpenClawConfig } from "../config/config.js"; import { createEmptyPluginRegistry } from "../plugins/registry.js"; import { setActivePluginRegistry } from "../plugins/runtime.js"; -vi.mock("../channels/plugins/bootstrap-registry.js", async () => { - const telegramSecrets = await import("../../extensions/telegram/src/secret-contract.ts"); +vi.mock("../channels/plugins/bootstrap-registry.js", () => { return { getBootstrapChannelPlugin: (id: string) => id === "telegram" diff --git a/src/secrets/runtime-legacy-x-search.test.ts b/src/secrets/runtime-legacy-x-search.test.ts index fdda52e91fe..9a948f29a01 100644 --- a/src/secrets/runtime-legacy-x-search.test.ts +++ b/src/secrets/runtime-legacy-x-search.test.ts @@ -1,4 +1,5 @@ import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; +import * as telegramSecrets from "../../extensions/telegram/src/secret-contract.ts"; import type { OpenClawConfig } from "../config/config.js"; import { createEmptyPluginRegistry } from "../plugins/registry.js"; import { setActivePluginRegistry } from "../plugins/runtime.js"; @@ -14,8 +15,7 @@ vi.mock("../plugins/web-search-providers.runtime.js", () => ({ resolvePluginWebSearchProviders: resolvePluginWebSearchProvidersMock, })); -vi.mock("../channels/plugins/bootstrap-registry.js", async () => { - const telegramSecrets = await import("../../extensions/telegram/src/secret-contract.ts"); +vi.mock("../channels/plugins/bootstrap-registry.js", () => { return { getBootstrapChannelPlugin: (id: string) => id === "telegram" diff --git a/src/secrets/runtime-matrix-shadowing.test.ts b/src/secrets/runtime-matrix-shadowing.test.ts index 89bada8ef58..39ae063d091 100644 --- a/src/secrets/runtime-matrix-shadowing.test.ts +++ b/src/secrets/runtime-matrix-shadowing.test.ts @@ -1,4 +1,5 @@ import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; +import * as matrixSecrets from "../../extensions/matrix/src/secret-contract.ts"; import type { AuthProfileStore } from "../agents/auth-profiles.js"; import type { OpenClawConfig } from "../config/config.js"; import { createEmptyPluginRegistry } from "../plugins/registry.js"; @@ -15,8 +16,7 @@ vi.mock("../plugins/web-search-providers.runtime.js", () => ({ resolvePluginWebSearchProviders: resolvePluginWebSearchProvidersMock, })); -vi.mock("../channels/plugins/bootstrap-registry.js", async () => { - const matrixSecrets = await import("../../extensions/matrix/src/secret-contract.ts"); +vi.mock("../channels/plugins/bootstrap-registry.js", () => { return { getBootstrapChannelPlugin: (id: string) => id === "matrix" diff --git a/src/secrets/runtime-matrix-top-level.test.ts b/src/secrets/runtime-matrix-top-level.test.ts index c534b58da73..4f567c0a3bb 100644 --- a/src/secrets/runtime-matrix-top-level.test.ts +++ b/src/secrets/runtime-matrix-top-level.test.ts @@ -1,4 +1,5 @@ import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; +import * as matrixSecrets from "../../extensions/matrix/src/secret-contract.ts"; import type { OpenClawConfig } from "../config/config.js"; import { createEmptyPluginRegistry } from "../plugins/registry.js"; import { setActivePluginRegistry } from "../plugins/runtime.js"; @@ -14,8 +15,7 @@ vi.mock("../plugins/web-search-providers.runtime.js", () => ({ resolvePluginWebSearchProviders: resolvePluginWebSearchProvidersMock, })); -vi.mock("../channels/plugins/bootstrap-registry.js", async () => { - const matrixSecrets = await import("../../extensions/matrix/src/secret-contract.ts"); +vi.mock("../channels/plugins/bootstrap-registry.js", () => { return { getBootstrapChannelPlugin: (id: string) => id === "matrix" diff --git a/src/secrets/runtime-nextcloud-talk-file-precedence.test.ts b/src/secrets/runtime-nextcloud-talk-file-precedence.test.ts index 969091e1e38..8a252b0f7f9 100644 --- a/src/secrets/runtime-nextcloud-talk-file-precedence.test.ts +++ b/src/secrets/runtime-nextcloud-talk-file-precedence.test.ts @@ -1,12 +1,11 @@ import { afterEach, beforeAll, describe, expect, it, vi } from "vitest"; +import * as nextcloudTalkSecrets from "../../extensions/nextcloud-talk/src/secret-contract.ts"; import type { AuthProfileStore } from "../agents/auth-profiles.js"; import type { OpenClawConfig } from "../config/config.js"; import { createEmptyPluginRegistry } from "../plugins/registry.js"; import { setActivePluginRegistry } from "../plugins/runtime.js"; -vi.mock("../channels/plugins/bootstrap-registry.js", async () => { - const nextcloudTalkSecrets = - await import("../../extensions/nextcloud-talk/src/secret-contract.ts"); +vi.mock("../channels/plugins/bootstrap-registry.js", () => { return { getBootstrapChannelPlugin: (id: string) => id === "nextcloud-talk" diff --git a/src/secrets/runtime-telegram-token-inheritance.test.ts b/src/secrets/runtime-telegram-token-inheritance.test.ts index 65ff623aeb5..b8cc64afbfe 100644 --- a/src/secrets/runtime-telegram-token-inheritance.test.ts +++ b/src/secrets/runtime-telegram-token-inheritance.test.ts @@ -1,11 +1,11 @@ import { afterEach, beforeAll, describe, expect, it, vi } from "vitest"; +import * as telegramSecrets from "../../extensions/telegram/src/secret-contract.ts"; import type { AuthProfileStore } from "../agents/auth-profiles.js"; import type { OpenClawConfig } from "../config/config.js"; import { createEmptyPluginRegistry } from "../plugins/registry.js"; import { setActivePluginRegistry } from "../plugins/runtime.js"; -vi.mock("../channels/plugins/bootstrap-registry.js", async () => { - const telegramSecrets = await import("../../extensions/telegram/src/secret-contract.ts"); +vi.mock("../channels/plugins/bootstrap-registry.js", () => { return { getBootstrapChannelPlugin: (id: string) => id === "telegram" diff --git a/src/secrets/runtime-zalo-token-activity.test.ts b/src/secrets/runtime-zalo-token-activity.test.ts index 0517f724190..b264252b83f 100644 --- a/src/secrets/runtime-zalo-token-activity.test.ts +++ b/src/secrets/runtime-zalo-token-activity.test.ts @@ -1,11 +1,11 @@ import { afterEach, beforeAll, describe, expect, it, vi } from "vitest"; +import * as zaloSecrets from "../../extensions/zalo/src/secret-contract.ts"; import type { AuthProfileStore } from "../agents/auth-profiles.js"; import type { OpenClawConfig } from "../config/config.js"; import { createEmptyPluginRegistry } from "../plugins/registry.js"; import { setActivePluginRegistry } from "../plugins/runtime.js"; -vi.mock("../channels/plugins/bootstrap-registry.js", async () => { - const zaloSecrets = await import("../../extensions/zalo/src/secret-contract.ts"); +vi.mock("../channels/plugins/bootstrap-registry.js", () => { return { getBootstrapChannelPlugin: (id: string) => id === "zalo"