Javascript mocking library for websockets. This project inspired by mock-socket library, most code still the same. But targets only plain websockets. Currently unstable, API will change.
Installation
npm install -D mock-websocket
Usage
To use within a node environment you can simply import or require the files directly. This option is great for phantomjs or CI environments.
; // OR const mockServer = Server;const mockWebSocket = WebSocket;
Native WebSocket Example
// chat.js { const chatSocket = 'ws://localhost:8080'; thismessages = ; chatSocket { thismessages; };}
// chat-test.js; ;