mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-12 07:20:45 +00:00
test(discord): fix monitor test typings
This commit is contained in:
@@ -55,8 +55,15 @@ describe("runDiscordGatewayLifecycle", () => {
|
||||
const start = vi.fn(params?.start ?? (async () => undefined));
|
||||
const stop = vi.fn(params?.stop ?? (async () => undefined));
|
||||
const threadStop = vi.fn();
|
||||
const runtimeLog = vi.fn();
|
||||
const runtimeError = vi.fn();
|
||||
const runtimeExit = vi.fn();
|
||||
const releaseEarlyGatewayErrorGuard = vi.fn();
|
||||
const runtime: RuntimeEnv = {
|
||||
log: runtimeLog,
|
||||
error: runtimeError,
|
||||
exit: runtimeExit,
|
||||
};
|
||||
return {
|
||||
start,
|
||||
stop,
|
||||
@@ -66,9 +73,7 @@ describe("runDiscordGatewayLifecycle", () => {
|
||||
lifecycleParams: {
|
||||
accountId: params?.accountId ?? "default",
|
||||
client: { getPlugin: vi.fn(() => undefined) } as unknown as Client,
|
||||
runtime: {
|
||||
error: runtimeError,
|
||||
} as RuntimeEnv,
|
||||
runtime,
|
||||
isDisallowedIntentsError: params?.isDisallowedIntentsError ?? (() => false),
|
||||
voiceManager: null,
|
||||
voiceManagerRef: { current: null },
|
||||
|
||||
@@ -20,8 +20,8 @@ const {
|
||||
} = vi.hoisted(() => {
|
||||
const createdBindingManagers: Array<{ stop: ReturnType<typeof vi.fn> }> = [];
|
||||
return {
|
||||
clientFetchUserMock: vi.fn(async () => ({ id: "bot-1" })),
|
||||
clientGetPluginMock: vi.fn(() => undefined),
|
||||
clientFetchUserMock: vi.fn(async (_target: string) => ({ id: "bot-1" })),
|
||||
clientGetPluginMock: vi.fn<(_name: string) => unknown>(() => undefined),
|
||||
createDiscordNativeCommandMock: vi.fn(() => ({ name: "mock-command" })),
|
||||
createNoopThreadBindingManagerMock: vi.fn(() => {
|
||||
const manager = { stop: vi.fn() };
|
||||
|
||||
Reference in New Issue
Block a user