mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 05:30:42 +00:00
refactor: trim slack test helper exports
This commit is contained in:
@@ -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">;
|
||||
|
||||
@@ -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>;
|
||||
};
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user