chore: Fix types in tests 18/N.

This commit is contained in:
cpojer
2026-02-17 12:00:18 +09:00
parent 43c97d18aa
commit 8ece8215aa
8 changed files with 67 additions and 41 deletions

View File

@@ -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 }

View File

@@ -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");

View File

@@ -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");