refactor(channels): dedupe transport and gateway test scaffolds

This commit is contained in:
Peter Steinberger
2026-02-16 14:52:15 +00:00
parent f717a13039
commit 93ca0ed54f
95 changed files with 4068 additions and 5221 deletions

View File

@@ -0,0 +1,35 @@
import type { SignalEventHandlerDeps, SignalReactionMessage } from "./event-handler.types.js";
export function createBaseSignalEventHandlerDeps(
overrides: Partial<SignalEventHandlerDeps> = {},
): SignalEventHandlerDeps {
return {
// oxlint-disable-next-line typescript/no-explicit-any
runtime: { log: () => {}, error: () => {} } as any,
cfg: {},
baseUrl: "http://localhost",
accountId: "default",
historyLimit: 5,
groupHistories: new Map(),
textLimit: 4000,
dmPolicy: "open",
allowFrom: ["*"],
groupAllowFrom: ["*"],
groupPolicy: "open",
reactionMode: "off",
reactionAllowlist: [],
mediaMaxBytes: 1024,
ignoreAttachments: true,
sendReadReceipts: false,
readReceiptsViaDaemon: false,
fetchAttachment: async () => null,
deliverReplies: async () => {},
resolveSignalReactionTargets: () => [],
isSignalReactionMessage: (
_reaction: SignalReactionMessage | null | undefined,
): _reaction is SignalReactionMessage => false,
shouldEmitSignalReactionNotification: () => false,
buildSignalReactionSystemEventText: () => "reaction",
...overrides,
};
}