initial commit

This commit is contained in:
2026-07-14 21:31:59 -07:00
commit bd79966218
61 changed files with 19379 additions and 0 deletions
@@ -0,0 +1,9 @@
import assert from "node:assert/strict";
import test from "node:test";
import { LiveClient } from "../dist/index.js";
test("client dispatches a validated server event", () => {
const socket = {}; const client = new LiveClient({ url: "ws://invalid", websocketFactory: () => socket }); let received;
client.on("live.enter", event => { received = event; }); client.connect();
socket.onmessage({ data: JSON.stringify({ version: 1, id: "a0000000-0000-4000-8000-000000000001", occurredAt: new Date().toISOString(), roomId: "1", type: "live.enter", payload: { viewer: { uid: "1", name: "A" } } }) });
assert.equal(received.payload.viewer.name, "A");
});