Skip to content

Instantly share code, notes, and snippets.

@shannonmoeller
Last active Aug 29, 2015
Embed
What would you like to do?
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