Skip to content

Commit 5432e6c

Browse files
committed
feat: add WebFingerLinkDispatcher support in MockFederation
1 parent 9423042 commit 5432e6c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

packages/testing/src/mock.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import type {
2121
SendActivityOptions,
2222
SendActivityOptionsForCollection,
2323
SenderKeyPair,
24+
WebFingerLinkDispatcher,
2425
} from "@fedify/fedify/federation";
2526
import type { JsonValue, NodeInfo } from "@fedify/fedify/nodeinfo";
2627
import type { DocumentLoader } from "@fedify/fedify/runtime";
@@ -108,6 +109,7 @@ export class MockFederation<TContextData> implements Federation<TContextData> {
108109
private activeQueues: Set<"inbox" | "outbox" | "fanout"> = new Set();
109110
public sentCounter = 0;
110111
private nodeInfoDispatcher?: NodeInfoDispatcher<TContextData>;
112+
private webFingerDispatcher?: WebFingerLinkDispatcher<TContextData>;
111113
private actorDispatchers: Map<string, ActorDispatcher<TContextData>> =
112114
new Map();
113115
public actorPath?: string;
@@ -190,6 +192,12 @@ export class MockFederation<TContextData> implements Federation<TContextData> {
190192
this.nodeInfoPath = path;
191193
}
192194

195+
setWebFingerLinkDispatcher(
196+
dispatcher: WebFingerLinkDispatcher<TContextData>,
197+
): void {
198+
this.webFingerDispatcher = dispatcher;
199+
}
200+
193201
setActorDispatcher(
194202
path: `${string}{identifier}${string}` | `${string}{handle}${string}`,
195203
dispatcher: ActorDispatcher<TContextData>,

0 commit comments

Comments
 (0)