diff --git a/src/session.test.ts b/src/session.test.ts index 39e66d5..59ae7d1 100644 --- a/src/session.test.ts +++ b/src/session.test.ts @@ -1,6 +1,6 @@ import { describe, expect, test } from "bun:test"; import * as Y from "yjs"; -import { getOrCreateSession, Session } from "./session"; +import { type WsData, getOrCreateSession, Session } from "./session"; describe("Session", () => { test("creates yjs doc on init", () => { @@ -13,8 +13,8 @@ describe("Session", () => { const session = new Session("test-room"); const mockWs = { send: () => {}, - data: { room: null as string | null }, - } as unknown as import("bun").ServerWebSocket<{ room: string | null }>; + data: { room: null as string | null, client: null }, + } as unknown as import("bun").ServerWebSocket; const client = { ws: mockWs }; expect(session.clients.size).toBe(0); @@ -36,8 +36,8 @@ describe("Session", () => { const mockWs = { send: () => {}, - data: { room: null as string | null }, - } as unknown as import("bun").ServerWebSocket<{ room: string | null }>; + data: { room: null as string | null, client: null }, + } as unknown as import("bun").ServerWebSocket; session.applyUpdate(update, { ws: mockWs }); expect(text.toString()).toBe("hello");