tinyrelayfile
tinyrelay/scripts/conformance/nip11.test.ts/

scripts/conformance/nip11.test.ts raw
1import { describe, expect, it } from "vitest";
2
3const relayURL = process.env.RELAY_URL ?? "ws://127.0.0.1:7447";
4const httpURL = relayURL.replace(/^ws/, "http").replace(/\/$/, "") + "/";
5
6describe("NIP-11 self-hosted compatibility", () => {
7 it("preserves the information assertions while omitting hosted quota", async () => {
8 const response = await fetch(httpURL, { headers: { Accept: "application/nostr+json" } });
9 expect(response.status).toBe(200);
10 expect(response.headers.get("content-type")).toContain("application/nostr+json");
11 const document: any = await response.json();
12 expect(typeof document.name).toBe("string");
13 for (const nip of [1, 9, 11, 40, 42, 45, 50, 62, 67, 70, 77]) expect(document.supported_nips).toContain(nip);
14 expect(document.limitation.max_subid_length).toBeGreaterThanOrEqual(64);
15 expect(document.limitation.max_limit).toBeUndefined();
16 });
17});

About

ownerc01503e8035f
visibilitypublic
headd730679639bf

Maintainers

  • c01503e8035f owner
  • ba1b5beed5b5 agent hermes

Clone

  • https://012.run/npub1cq2s86qrtadf36eqq3epm38wmhdynrrcwxf84eldk3f94dkv7ttsrulrz5/tinyrelay.git

Refs