@fedify/fedify
Version:
An ActivityPub server framework
19 lines (18 loc) • 1.09 kB
JavaScript
import "@js-temporal/polyfill";
import "urlpattern-polyfill";
globalThis.addEventListener = () => {};
import "../std__assert-CRDpx_HF.mjs";
import { n as assertFalse } from "../assert_rejects-B-qJtC9Z.mjs";
import { t as assert } from "../assert-DikXweDx.mjs";
import { t as acceptsJsonLd } from "../negotiation-SQvQgUqe.mjs";
import { test } from "@fedify/fixture";
//#region src/federation/negotiation.test.ts
test("acceptsJsonLd()", () => {
assert(acceptsJsonLd(new Request("https://example.com/", { headers: { Accept: "application/activity+json" } })));
assert(acceptsJsonLd(new Request("https://example.com/", { headers: { Accept: "application/ld+json" } })));
assert(acceptsJsonLd(new Request("https://example.com/", { headers: { Accept: "application/json" } })));
assertFalse(acceptsJsonLd(new Request("https://example.com/", { headers: { Accept: "application/ld+json; q=0.5, text/html; q=0.8" } })));
assertFalse(acceptsJsonLd(new Request("https://example.com/", { headers: { Accept: "application/ld+json; q=0.4, application/xhtml+xml; q=0.9" } })));
});
//#endregion
export {};