SuperWSTest
JSON →SuperWSTest (v3.0.0) extends supertest with WebSocket testing capabilities, allowing you to test WebSocket endpoints alongside HTTP endpoints using the same request-like API. It integrates seamlessly with supertest and provides methods like .ws(), .expectText(), .expectJson(), and .close(). The package ships TypeScript types, supports both local and remote servers, auto-closes connections via server.close, and offers scoped instances for parallel test isolation. Unlike raw ws integration, it provides a supertest-compatible fluent API with built-in message filtering and expectations.
Resources
packagesuperwstest ↗