Files
piik/tests/relay-capability.test.ts
T
AAA 0a5c21025f fix(media): demote corroborated relay parents (#164)
Preserve exact selected edges across unrelated route revisions, demote corroborated bad relay parents, and parameterize the bounded endpoint cap while retaining the production default of two.
2026-08-22 03:55:11 +08:00

19 lines
535 B
TypeScript

import { describe, expect, it } from "vitest";
import {
relayCapacityMessageForBrowser,
} from "../src/client/media/relay-capability.ts";
describe("browser relay capability", () => {
it("advertises the bounded browser maximum to a peer-assisted server", () => {
expect(relayCapacityMessageForBrowser(true)).toEqual({
type: "relay-capacity",
downstreamEdges: 3,
});
});
it("does not create a relay message for ordinary P2P", () => {
expect(relayCapacityMessageForBrowser(false)).toBeNull();
});
});