From 4b2c7404e513b6c93b414d1a6d4045cc8e36e16e Mon Sep 17 00:00:00 2001 From: Vincent Koc Date: Fri, 3 Apr 2026 23:03:02 +0900 Subject: [PATCH] test(types): remove remaining testing barrel references --- extensions/deepgram/audio.live.test.ts | 2 +- extensions/discord/src/channel.test.ts | 2 +- extensions/discord/src/monitor.tool-result.test-harness.ts | 2 +- .../src/monitor/message-handler.module-test-helpers.ts | 2 +- extensions/discord/src/send.test-harness.ts | 2 +- extensions/line/api.ts | 5 ++++- extensions/line/runtime-api.ts | 5 ++++- extensions/openshell/src/backend.e2e.test.ts | 2 +- extensions/signal/src/monitor.tool-result.test-harness.ts | 2 +- extensions/telegram/src/bot-native-commands.test-helpers.ts | 2 +- .../telegram/src/bot.create-telegram-bot.test-harness.ts | 2 +- extensions/telegram/src/channel.test.ts | 2 +- extensions/telegram/src/send.test-harness.ts | 2 +- extensions/telegram/src/target-writeback.test-shared.ts | 2 +- 14 files changed, 20 insertions(+), 14 deletions(-) diff --git a/extensions/deepgram/audio.live.test.ts b/extensions/deepgram/audio.live.test.ts index ce97fe732a0..bdfba2fca5e 100644 --- a/extensions/deepgram/audio.live.test.ts +++ b/extensions/deepgram/audio.live.test.ts @@ -1,5 +1,5 @@ -import { isLiveTestEnabled } from "openclaw/plugin-sdk/testing"; import { describe, expect, it } from "vitest"; +import { isLiveTestEnabled } from "../../src/agents/live-test-helpers.js"; import { transcribeDeepgramAudio } from "./audio.js"; const DEEPGRAM_KEY = process.env.DEEPGRAM_API_KEY ?? ""; diff --git a/extensions/discord/src/channel.test.ts b/extensions/discord/src/channel.test.ts index 0cd32db2649..542303d48ec 100644 --- a/extensions/discord/src/channel.test.ts +++ b/extensions/discord/src/channel.test.ts @@ -1,5 +1,5 @@ -import type { PluginRuntime } from "openclaw/plugin-sdk/testing"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; +import type { PluginRuntime } from "../../../src/plugins/runtime/types.js"; import { createStartAccountContext } from "../../../test/helpers/plugins/start-account-context.js"; import type { ResolvedDiscordAccount } from "./accounts.js"; import type { OpenClawConfig } from "./runtime-api.js"; diff --git a/extensions/discord/src/monitor.tool-result.test-harness.ts b/extensions/discord/src/monitor.tool-result.test-harness.ts index d14f10b5f5d..a74555324fa 100644 --- a/extensions/discord/src/monitor.tool-result.test-harness.ts +++ b/extensions/discord/src/monitor.tool-result.test-harness.ts @@ -1,5 +1,5 @@ -import type { MockFn } from "openclaw/plugin-sdk/testing"; import { vi } from "vitest"; +import type { MockFn } from "../../../src/test-utils/vitest-mock-fn.js"; export const sendMock: MockFn = vi.fn(); export const reactMock: MockFn = vi.fn(); diff --git a/extensions/discord/src/monitor/message-handler.module-test-helpers.ts b/extensions/discord/src/monitor/message-handler.module-test-helpers.ts index 66fbeeb0367..4164dee90a2 100644 --- a/extensions/discord/src/monitor/message-handler.module-test-helpers.ts +++ b/extensions/discord/src/monitor/message-handler.module-test-helpers.ts @@ -1,5 +1,5 @@ -import type { MockFn } from "openclaw/plugin-sdk/testing"; import { vi } from "vitest"; +import type { MockFn } from "../../../../src/test-utils/vitest-mock-fn.js"; export const preflightDiscordMessageMock: MockFn = vi.fn(); export const processDiscordMessageMock: MockFn = vi.fn(); diff --git a/extensions/discord/src/send.test-harness.ts b/extensions/discord/src/send.test-harness.ts index c0069f99770..f3c5ae36842 100644 --- a/extensions/discord/src/send.test-harness.ts +++ b/extensions/discord/src/send.test-harness.ts @@ -1,5 +1,5 @@ -import type { MockFn } from "openclaw/plugin-sdk/testing"; import { vi } from "vitest"; +import type { MockFn } from "../../../src/test-utils/vitest-mock-fn.js"; type DiscordWebMediaMockFactoryResult = { loadWebMedia: MockFn; diff --git a/extensions/line/api.ts b/extensions/line/api.ts index d49c3124cc9..128edfd7cf0 100644 --- a/extensions/line/api.ts +++ b/extensions/line/api.ts @@ -7,7 +7,10 @@ export type { export { clearAccountEntryFields } from "openclaw/plugin-sdk/core"; export { buildChannelConfigSchema } from "openclaw/plugin-sdk/channel-config-schema"; export type { ReplyPayload } from "openclaw/plugin-sdk/reply-runtime"; -export type { ChannelAccountSnapshot, ChannelGatewayContext } from "openclaw/plugin-sdk/testing"; +export type { + ChannelAccountSnapshot, + ChannelGatewayContext, +} from "../../src/channels/plugins/types.js"; export type { ChannelStatusIssue } from "openclaw/plugin-sdk/channel-contract"; export { buildComputedAccountStatusSnapshot, diff --git a/extensions/line/runtime-api.ts b/extensions/line/runtime-api.ts index 79ec385a93b..92d76f1afc3 100644 --- a/extensions/line/runtime-api.ts +++ b/extensions/line/runtime-api.ts @@ -10,7 +10,10 @@ export type { export { clearAccountEntryFields } from "openclaw/plugin-sdk/core"; export { buildChannelConfigSchema } from "openclaw/plugin-sdk/channel-config-schema"; export type { ReplyPayload } from "openclaw/plugin-sdk/reply-runtime"; -export type { ChannelAccountSnapshot, ChannelGatewayContext } from "openclaw/plugin-sdk/testing"; +export type { + ChannelAccountSnapshot, + ChannelGatewayContext, +} from "../../src/channels/plugins/types.js"; export type { ChannelStatusIssue } from "openclaw/plugin-sdk/channel-contract"; export type { ChannelSetupDmPolicy, ChannelSetupWizard } from "openclaw/plugin-sdk/setup"; export { diff --git a/extensions/openshell/src/backend.e2e.test.ts b/extensions/openshell/src/backend.e2e.test.ts index e35886817cd..91a3916eea7 100644 --- a/extensions/openshell/src/backend.e2e.test.ts +++ b/extensions/openshell/src/backend.e2e.test.ts @@ -3,8 +3,8 @@ import fs from "node:fs/promises"; import net from "node:net"; import os from "node:os"; import path from "node:path"; -import { createSandboxTestContext } from "openclaw/plugin-sdk/testing"; import { describe, expect, it } from "vitest"; +import { createSandboxTestContext } from "../../../src/agents/sandbox/test-fixtures.js"; import { createSandboxBrowserConfig, createSandboxPruneConfig, diff --git a/extensions/signal/src/monitor.tool-result.test-harness.ts b/extensions/signal/src/monitor.tool-result.test-harness.ts index d2330bd69b7..67683b9e3b0 100644 --- a/extensions/signal/src/monitor.tool-result.test-harness.ts +++ b/extensions/signal/src/monitor.tool-result.test-harness.ts @@ -1,5 +1,5 @@ -import type { MockFn } from "openclaw/plugin-sdk/testing"; import { beforeEach, vi } from "vitest"; +import type { MockFn } from "../../../src/test-utils/vitest-mock-fn.js"; import type { SignalDaemonExitEvent, SignalDaemonHandle } from "./daemon.js"; type SignalToolResultTestMocks = { diff --git a/extensions/telegram/src/bot-native-commands.test-helpers.ts b/extensions/telegram/src/bot-native-commands.test-helpers.ts index 296ce9aa680..80f194b7bbb 100644 --- a/extensions/telegram/src/bot-native-commands.test-helpers.ts +++ b/extensions/telegram/src/bot-native-commands.test-helpers.ts @@ -2,8 +2,8 @@ import type { OpenClawConfig } from "openclaw/plugin-sdk/config-runtime"; import type { ChannelGroupPolicy } from "openclaw/plugin-sdk/config-runtime"; import type { TelegramAccountConfig } from "openclaw/plugin-sdk/config-runtime"; import type { RuntimeEnv } from "openclaw/plugin-sdk/runtime-env"; -import type { MockFn } from "openclaw/plugin-sdk/testing"; import { vi } from "vitest"; +import type { MockFn } from "../../../src/test-utils/vitest-mock-fn.js"; import { createNativeCommandTestParams } from "./bot-native-commands.fixture-test-support.js"; import type { RegisterTelegramNativeCommandsParams } from "./bot-native-commands.js"; import { registerTelegramNativeCommands } from "./bot-native-commands.js"; diff --git a/extensions/telegram/src/bot.create-telegram-bot.test-harness.ts b/extensions/telegram/src/bot.create-telegram-bot.test-harness.ts index c6b11f5d2da..dd68dc66700 100644 --- a/extensions/telegram/src/bot.create-telegram-bot.test-harness.ts +++ b/extensions/telegram/src/bot.create-telegram-bot.test-harness.ts @@ -7,8 +7,8 @@ import { type MsgContext, type ReplyPayload, } from "openclaw/plugin-sdk/reply-runtime"; -import type { MockFn } from "openclaw/plugin-sdk/testing"; import { beforeEach, vi } from "vitest"; +import type { MockFn } from "../../../src/test-utils/vitest-mock-fn.js"; import type { TelegramBotDeps } from "./bot-deps.js"; type AnyMock = ReturnType; diff --git a/extensions/telegram/src/channel.test.ts b/extensions/telegram/src/channel.test.ts index 7aac2e3ced5..82309b9ec82 100644 --- a/extensions/telegram/src/channel.test.ts +++ b/extensions/telegram/src/channel.test.ts @@ -1,6 +1,6 @@ import type { OpenClawConfig } from "openclaw/plugin-sdk/config-runtime"; -import type { PluginRuntime } from "openclaw/plugin-sdk/testing"; import { afterEach, describe, expect, it, vi } from "vitest"; +import type { PluginRuntime } from "../../../src/plugins/runtime/types.js"; import { createStartAccountContext } from "../../../test/helpers/plugins/start-account-context.js"; import type { ResolvedTelegramAccount } from "./accounts.js"; import * as auditModule from "./audit.js"; diff --git a/extensions/telegram/src/send.test-harness.ts b/extensions/telegram/src/send.test-harness.ts index 25b04af4479..466123e05eb 100644 --- a/extensions/telegram/src/send.test-harness.ts +++ b/extensions/telegram/src/send.test-harness.ts @@ -5,8 +5,8 @@ import { kindFromMime, normalizePollInput, } from "openclaw/plugin-sdk/media-runtime"; -import type { MockFn } from "openclaw/plugin-sdk/testing"; import { beforeEach, vi } from "vitest"; +import type { MockFn } from "../../../src/test-utils/vitest-mock-fn.js"; const { botApi, botCtorSpy } = vi.hoisted(() => ({ botApi: { diff --git a/extensions/telegram/src/target-writeback.test-shared.ts b/extensions/telegram/src/target-writeback.test-shared.ts index ceb91dadacb..e82535c17b9 100644 --- a/extensions/telegram/src/target-writeback.test-shared.ts +++ b/extensions/telegram/src/target-writeback.test-shared.ts @@ -1,5 +1,5 @@ -import type { OpenClawConfig } from "openclaw/plugin-sdk/testing"; import { beforeEach, describe, expect, it, vi } from "vitest"; +import type { OpenClawConfig } from "../../../src/config/config.js"; export const readConfigFileSnapshotForWrite = vi.fn(); export const writeConfigFile = vi.fn();