diff --git a/src/test/setup.ts b/src/test/setup.ts index eba54c2..fb2c703 100644 --- a/src/test/setup.ts +++ b/src/test/setup.ts @@ -1,7 +1,13 @@ /** * Vitest setup file * - * Polyfills IndexedDB for Node.js test environment. - * This allows Dexie to work in tests without a browser. + * Polyfills browser APIs for Node.js test environment. */ + +// Polyfill IndexedDB - allows Dexie to work in tests import "fake-indexeddb/auto"; + +// Polyfill WebSocket - required by nostr-tools relay code +import { WebSocket } from "ws"; +// @ts-expect-error - polyfilling global WebSocket for Node.js +globalThis.WebSocket = WebSocket;