@@ -36,6 +36,7 @@ import {
3636 respondWithObjectIfAcceptable ,
3737} from "./handler.ts" ;
3838import { MemoryKvStore } from "./kv.ts" ;
39+ import { createFederation } from "./middleware.ts" ;
3940
4041test ( "acceptsJsonLd()" , ( ) => {
4142 assert ( acceptsJsonLd (
@@ -68,7 +69,9 @@ test("acceptsJsonLd()", () => {
6869} ) ;
6970
7071test ( "handleActor()" , async ( ) => {
72+ const federation = createFederation < void > ( { kv : new MemoryKvStore ( ) } ) ;
7173 let context = createRequestContext < void > ( {
74+ federation,
7275 data : undefined ,
7376 url : new URL ( "https://example.com/" ) ,
7477 getActorUri ( identifier ) {
@@ -332,7 +335,9 @@ test("handleActor()", async () => {
332335} ) ;
333336
334337test ( "handleObject()" , async ( ) => {
338+ const federation = createFederation < void > ( { kv : new MemoryKvStore ( ) } ) ;
335339 let context = createRequestContext < void > ( {
340+ federation,
336341 data : undefined ,
337342 url : new URL ( "https://example.com/" ) ,
338343 getObjectUri ( _cls , values ) {
@@ -591,7 +596,9 @@ test("handleObject()", async () => {
591596} ) ;
592597
593598test ( "handleCollection()" , async ( ) => {
599+ const federation = createFederation < void > ( { kv : new MemoryKvStore ( ) } ) ;
594600 let context = createRequestContext < void > ( {
601+ federation,
595602 data : undefined ,
596603 url : new URL ( "https://example.com/" ) ,
597604 getActorUri ( identifier ) {
@@ -1142,7 +1149,9 @@ test("handleInbox()", async () => {
11421149 method : "POST" ,
11431150 body : JSON . stringify ( await activity . toJsonLd ( ) ) ,
11441151 } ) ;
1152+ const federation = createFederation < void > ( { kv : new MemoryKvStore ( ) } ) ;
11451153 const unsignedContext = createRequestContext ( {
1154+ federation,
11461155 request : unsignedRequest ,
11471156 url : new URL ( unsignedRequest . url ) ,
11481157 data : undefined ,
@@ -1221,6 +1230,7 @@ test("handleInbox()", async () => {
12211230 rsaPublicKey3 . id ! ,
12221231 ) ;
12231232 const signedContext = createRequestContext ( {
1233+ federation,
12241234 request : signedRequest ,
12251235 url : new URL ( signedRequest . url ) ,
12261236 data : undefined ,
@@ -1291,6 +1301,7 @@ test("handleInbox()", async () => {
12911301 rsaPublicKey3 . id ! ,
12921302 ) ;
12931303 const signedInvalidContext = createRequestContext ( {
1304+ federation,
12941305 request : signedInvalidRequest ,
12951306 url : new URL ( signedInvalidRequest . url ) ,
12961307 data : undefined ,
0 commit comments