mock-socket.io

1.1.0 • Public • Published

mock-socket.io

Build Status

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`

license

VOL

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.1.0
    15
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.1.0
    15
  • 1.0.0
    1

Package Sidebar

Install

npm i mock-socket.io

Weekly Downloads

16

Version

1.1.0

License

VOL

Last publish

Collaborators

  • artskydj