ws-mock
Node module for mocking Web Socket (server side). Can be very helpful if you want to test ws-dependent code.
Usage
First install via npm:
- npm:
npm install ws-mock
simple example:
var WsServerMock = WsServer; // create ws server instance var wsServer = ; // bind events wsServer; // create ws connection var wsConn = wsServer; // "new connection..." // send message that will be received by wsServer wsConn; // "incoming message: dummy message" // close a ws connection wsConn; // "connection closed..." // clear all current connections wsServer;