mock-socket.io
v1.1.0
Published
Simple mock for socket.io, for testing!
Downloads
41
Readme
mock-socket.io
Simple mock for socket.io, for testing!
Only the basics of socket.io are supported. Rooms, namespaces, etc. are not supported. If you're using socket.io for a simple app, this is a nice drop-in replacement.
Issues and Pull Requests are welcome.
usage
server.js
var Server = require('mock-socket.io').Server
var io = new Server() //parameters will be ignored
//do stuff with `io`
module.exports = yourThing
module.exports.io = io
client.js
var Client = require('mock-socket.io').Client
var serverIo = require('./server.js').io //above
var io = new Client(serverIo)
//do stuff with `io`