mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 19:18:26 +00:00
chore: Fix types in tests 18/N.
This commit is contained in:
@@ -79,7 +79,7 @@ function createHandler(config: DiscordExecApprovalConfig, accountId = "default")
|
||||
});
|
||||
}
|
||||
|
||||
type ExecApprovalHandlerInternals = DiscordExecApprovalHandler & {
|
||||
type ExecApprovalHandlerInternals = {
|
||||
pending: Map<
|
||||
string,
|
||||
{ discordMessageId: string; discordChannelId: string; timeoutId: NodeJS.Timeout }
|
||||
|
||||
@@ -12,12 +12,12 @@ const readSessionUpdatedAt = vi.fn(() => undefined);
|
||||
const resolveStorePath = vi.fn(() => "/tmp/openclaw-discord-process-test-sessions.json");
|
||||
|
||||
vi.mock("../send.js", () => ({
|
||||
reactMessageDiscord: (...args: unknown[]) => reactMessageDiscord(...args),
|
||||
removeReactionDiscord: (...args: unknown[]) => removeReactionDiscord(...args),
|
||||
reactMessageDiscord,
|
||||
removeReactionDiscord,
|
||||
}));
|
||||
|
||||
vi.mock("../../auto-reply/dispatch.js", () => ({
|
||||
dispatchInboundMessage: (...args: unknown[]) => dispatchInboundMessage(...args),
|
||||
dispatchInboundMessage,
|
||||
}));
|
||||
|
||||
vi.mock("../../auto-reply/reply/reply-dispatcher.js", () => ({
|
||||
@@ -36,12 +36,12 @@ vi.mock("../../auto-reply/reply/reply-dispatcher.js", () => ({
|
||||
}));
|
||||
|
||||
vi.mock("../../channels/session.js", () => ({
|
||||
recordInboundSession: (...args: unknown[]) => recordInboundSession(...args),
|
||||
recordInboundSession,
|
||||
}));
|
||||
|
||||
vi.mock("../../config/sessions.js", () => ({
|
||||
readSessionUpdatedAt: (...args: unknown[]) => readSessionUpdatedAt(...args),
|
||||
resolveStorePath: (...args: unknown[]) => resolveStorePath(...args),
|
||||
readSessionUpdatedAt,
|
||||
resolveStorePath,
|
||||
}));
|
||||
|
||||
const { processDiscordMessage } = await import("./message-handler.process.js");
|
||||
|
||||
@@ -27,6 +27,7 @@ describe("resolveDiscordRestFetch", () => {
|
||||
const runtime = {
|
||||
log: vi.fn(),
|
||||
error: vi.fn(),
|
||||
exit: vi.fn(),
|
||||
} as const;
|
||||
undiciFetchMock.mockReset().mockResolvedValue(new Response("ok", { status: 200 }));
|
||||
proxyAgentSpy.mockReset();
|
||||
@@ -51,6 +52,7 @@ describe("resolveDiscordRestFetch", () => {
|
||||
const runtime = {
|
||||
log: vi.fn(),
|
||||
error: vi.fn(),
|
||||
exit: vi.fn(),
|
||||
} as const;
|
||||
const { __testing } = await import("./provider.js");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user