jiftechnify / nostr-fetch

A utility library that allows JS/TS apps to effortlessly fetch past events from Nostr relays.
MIT License
45 stars 2 forks source link

Latest nostr-tools don't play well with vitest-websocket-mock #249

Open jiftechnify opened 5 months ago

jiftechnify commented 5 months ago

nostr-tools >= 2.1.9 no longer compatible with websocket-polyfill, so we are forced to inject WebSocket impl. in Node.js environment.

On the other hand, vitest-websocket-mock only mocks global WebSocket by default. It could mock other impls but for some reason it doesn't work (maybe due to monorepo setting?)

For the reason above, we can't test adapter-nostr-tools-v2 with vitest-websocket-mock...