From d74c8423c79f90ee8e675eb305e51f14b2756d5d Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Tue, 28 Apr 2026 00:11:44 +0100 Subject: [PATCH] test: fix plugin runtime env test types --- .../discord/src/monitor/provider.allowlist.test.ts | 9 ++++----- extensions/feishu/src/monitor.reaction.test.ts | 10 +++++----- extensions/feishu/src/setup-surface.test.ts | 6 ++---- 3 files changed, 11 insertions(+), 14 deletions(-) diff --git a/extensions/discord/src/monitor/provider.allowlist.test.ts b/extensions/discord/src/monitor/provider.allowlist.test.ts index b31b067f1c1..33f042467b2 100644 --- a/extensions/discord/src/monitor/provider.allowlist.test.ts +++ b/extensions/discord/src/monitor/provider.allowlist.test.ts @@ -1,5 +1,4 @@ -import type { RuntimeEnv } from "openclaw/plugin-sdk/runtime-env"; -import { createNonExitingTypedRuntimeEnv } from "openclaw/plugin-sdk/testing"; +import { createNonExitingRuntimeEnv } from "openclaw/plugin-sdk/testing"; import { beforeEach, describe, expect, it, vi } from "vitest"; import * as resolveChannelsModule from "../resolve-channels.js"; import * as resolveUsersModule from "../resolve-users.js"; @@ -29,7 +28,7 @@ describe("resolveDiscordAllowlistConfig", () => { }); it("canonicalizes resolved user names to ids in runtime config", async () => { - const runtime = createNonExitingTypedRuntimeEnv(); + const runtime = createNonExitingRuntimeEnv(); const result = await resolveDiscordAllowlistConfig({ token: "token", allowFrom: ["Alice", "111", "*"], @@ -63,7 +62,7 @@ describe("resolveDiscordAllowlistConfig", () => { channelName: "missing-room", }, ]); - const runtime = createNonExitingTypedRuntimeEnv(); + const runtime = createNonExitingRuntimeEnv(); await resolveDiscordAllowlistConfig({ token: "token", @@ -116,7 +115,7 @@ describe("resolveDiscordAllowlistConfig", () => { }, ]); - const runtime = createNonExitingTypedRuntimeEnv(); + const runtime = createNonExitingRuntimeEnv(); await resolveDiscordAllowlistConfig({ token: "token", diff --git a/extensions/feishu/src/monitor.reaction.test.ts b/extensions/feishu/src/monitor.reaction.test.ts index 1933745bf63..e006d417f92 100644 --- a/extensions/feishu/src/monitor.reaction.test.ts +++ b/extensions/feishu/src/monitor.reaction.test.ts @@ -3,9 +3,9 @@ import { resolveInboundDebounceMs, } from "openclaw/plugin-sdk/channel-inbound-debounce"; import { hasControlCommand } from "openclaw/plugin-sdk/command-detection"; -import { createNonExitingTypedRuntimeEnv } from "openclaw/plugin-sdk/testing"; +import { createNonExitingRuntimeEnv } from "openclaw/plugin-sdk/testing"; import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; -import type { ClawdbotConfig, PluginRuntime, RuntimeEnv } from "../runtime-api.js"; +import type { ClawdbotConfig, PluginRuntime } from "../runtime-api.js"; import { parseFeishuMessageEvent, type FeishuMessageEvent } from "./bot.js"; import * as dedup from "./dedup.js"; import { @@ -175,7 +175,7 @@ async function setupDebounceMonitor(params?: { await monitorSingleAccount({ cfg: buildDebounceConfig(), account: buildDebounceAccount(), - runtime: createNonExitingTypedRuntimeEnv(), + runtime: createNonExitingRuntimeEnv(), botOpenIdSource: { kind: "prefetched", botOpenId: params?.botOpenId ?? "ou_bot", @@ -457,7 +457,7 @@ describe("monitorSingleAccount lifecycle", () => { await monitorSingleAccount({ cfg: buildDebounceConfig(), account: buildDebounceAccount(), - runtime: createNonExitingTypedRuntimeEnv(), + runtime: createNonExitingRuntimeEnv(), botOpenIdSource: { kind: "prefetched", botOpenId: "ou_bot", @@ -482,7 +482,7 @@ describe("monitorSingleAccount lifecycle", () => { monitorSingleAccount({ cfg: buildDebounceConfig(), account: buildDebounceAccount(), - runtime: createNonExitingTypedRuntimeEnv(), + runtime: createNonExitingRuntimeEnv(), botOpenIdSource: { kind: "prefetched", botOpenId: "ou_bot", diff --git a/extensions/feishu/src/setup-surface.test.ts b/extensions/feishu/src/setup-surface.test.ts index d734fc6584c..1f207c5e7cb 100644 --- a/extensions/feishu/src/setup-surface.test.ts +++ b/extensions/feishu/src/setup-surface.test.ts @@ -1,5 +1,5 @@ import { - createNonExitingTypedRuntimeEnv, + createNonExitingRuntimeEnv, createPluginSetupWizardConfigure, createPluginSetupWizardStatus, createTestWizardPrompter, @@ -67,8 +67,6 @@ async function getStatusWithEnvRefs(params: { appIdKey: string; appSecretKey: st const feishuConfigure = createPluginSetupWizardConfigure(feishuPlugin); const feishuGetStatus = createPluginSetupWizardStatus(feishuPlugin); -type FeishuConfigureRuntime = Parameters[0]["runtime"]; - describe("feishu setup wizard", () => { it("does not throw when config appId/appSecret are SecretRef objects", async () => { const text = vi @@ -95,7 +93,7 @@ describe("feishu setup wizard", () => { }, } as never, prompter, - runtime: createNonExitingTypedRuntimeEnv(), + runtime: createNonExitingRuntimeEnv(), }), ).resolves.toBeTruthy(); });