refactor: trim slack test helper exports

This commit is contained in:
Peter Steinberger
2026-05-01 20:26:34 +01:00
parent ca2cd6a8ab
commit 38e162dc71
3 changed files with 5 additions and 10 deletions

View File

@@ -1,10 +1,5 @@
import type { WebFetchProviderPlugin } from "openclaw/plugin-sdk/provider-web-fetch-contract";
type FirecrawlWebFetchProviderSharedFields = Omit<
WebFetchProviderPlugin,
"applySelectionConfig" | "createTool"
>;
function ensureRecord(target: Record<string, unknown>, key: string): Record<string, unknown> {
const current = target[key];
if (current && typeof current === "object" && !Array.isArray(current)) {
@@ -57,4 +52,4 @@ export const FIRECRAWL_WEB_FETCH_PROVIDER_SHARED = {
const webFetch = ensureRecord(pluginConfig, "webFetch");
webFetch.apiKey = value;
},
} satisfies FirecrawlWebFetchProviderSharedFields;
} satisfies Omit<WebFetchProviderPlugin, "applySelectionConfig" | "createTool">;

View File

@@ -1,13 +1,13 @@
import type { WebClient } from "@slack/web-api";
import { vi } from "vitest";
export type SlackEditTestClient = WebClient & {
type SlackEditTestClient = WebClient & {
chat: {
update: ReturnType<typeof vi.fn>;
};
};
export type SlackSendTestClient = WebClient & {
type SlackSendTestClient = WebClient & {
conversations: {
open: ReturnType<typeof vi.fn>;
};

View File

@@ -101,7 +101,7 @@ function ensureSlackTestRuntime(): {
export const flush = () => new Promise((resolve) => setTimeout(resolve, 0));
export async function waitForSlackEvent(name: string) {
async function waitForSlackEvent(name: string) {
for (let i = 0; i < 10; i += 1) {
if (getSlackHandlers()?.has(name)) {
return;
@@ -142,7 +142,7 @@ export async function stopSlackMonitor(params: {
await params.run;
}
export async function runSlackEventOnce(
async function runSlackEventOnce(
monitorSlackProvider: SlackProviderMonitor,
name: string,
args: unknown,