Skip to content

Instantly share code, notes, and snippets.

@shannonmoeller
Last active August 29, 2015 14:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shannonmoeller/b6b2fab1f8dd2ec42d89 to your computer and use it in GitHub Desktop.
Save shannonmoeller/b6b2fab1f8dd2ec42d89 to your computer and use it in GitHub Desktop.
Mock Socket
var es = require('event-stream'),
reader = es.readArray([mockDataIn]),
writer = es.writeArray(function (err, mockDataOut){
assert(mockDataOut);
}),
mockSocket = es.duplex(writer, reader);
mockSocket.pipe(...).pipe(mockSocket);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment