vitest-websocket-mock
JSON →A mock WebSocket server for Vitest tests, forked from jest-websocket-mock. Current stable version is 0.5.0. It provides a WS class to create mock servers, track messages, and send responses, with Vitest-specific matchers and helpers. Works with Vitest >=3 and TypeScript types are included. Key differentiators: seamless Vitest integration (no Jest dependency), supports jsonProtocol, and includes async promises (connected, nextMessage, closed) for precise test timing.
Resources
packagevitest-websocket-mock ↗
API endpoints
full doc /v1/registry/vitest-websocket-mock