@fedify/fedify
Version:
An ActivityPub server framework
22 lines (21 loc) • 1.26 kB
JavaScript
import "@js-temporal/polyfill";
import "urlpattern-polyfill";
globalThis.addEventListener = () => {};
import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
import "../std__assert-CRDpx_HF.mjs";
import { n as digest, t as buildCollectionSynchronizationHeader } from "../collection-D-HqUuA2.mjs";
import { test } from "@fedify/fixture";
import { decodeHex } from "byte-encodings/hex";
//#region src/federation/collection.test.ts
test("digest()", async () => {
assertEquals(await digest([
new URL("https://testing.example.org/users/1"),
new URL("https://testing.example.org/users/2"),
new URL("https://testing.example.org/users/2")
]), decodeHex("c33f48cd341ef046a206b8a72ec97af65079f9a3a9b90eef79c5920dce45c61f"));
});
test("buildCollectionSynchronizationHeader()", async () => {
assertEquals(await buildCollectionSynchronizationHeader("https://testing.example.org/users/1/followers", ["https://testing.example.org/users/2", "https://testing.example.org/users/1"]), "collectionId=\"https://testing.example.org/users/1/followers\", url=\"https://testing.example.org/users/1/followers?base-url=https%3A%2F%2Ftesting.example.org%2F\", digest=\"c33f48cd341ef046a206b8a72ec97af65079f9a3a9b90eef79c5920dce45c61f\"");
});
//#endregion
export {};