Socket.io Stub
A socket stub to use when testing socket.io code
Using the Stub
const manager = { socket;}; ;
Installation
npm i socket.io-stub --save-dev
yarn add socket.io-stub --dev
Tests
yarn test
Methods
new SocketStub(properties: ?object)
Instantiate a new socket stub. You can pass a properties object into the constructor to apply properties on the Socket
simulate(event: string, payload: any)
Simulate an event on the socket
clear
Clear all tracked emitted events from socket