jest-websocket-mock
JSON →A library for mocking WebSocket servers in Jest tests. Version 2.5.0 is the current stable release with no fixed cadence. It provides a WS class to simulate a WebSocket server, track messages, and assert interactions. Supports JSON protocol auto-serialization, error simulation, and graceful close. Ships TypeScript definitions. Key differentiators: built-in connected/closed/nextMessage promises for async test flow, static clean() method to reset between tests, and compatibility with popular patterns like redux-saga and react hooks via example code.
Traffic · last 30 days stale · no recent hits
total hits 11
actors 3 distinct systems
last hit 17d ago AhrefsBot
top countries 🇺🇸 United States · 🇸🇬 Singapore · 🇨🇦 Canada · 🇵🇰 Pakistan
Resources
packagejest-websocket-mock ↗
API endpoints
full doc /v1/registry/jest-websocket-mock