Skip to content

Instantly share code, notes, and snippets.

@daithi-coombes
Created December 19, 2013 13:33
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 daithi-coombes/8039142 to your computer and use it in GitHub Desktop.
Save daithi-coombes/8039142 to your computer and use it in GitHub Desktop.
NodeJS Mock for http.serverResponse
!#/usr/bin/env node
/**
* Mock https.serverResponse
* @type {Object}
*/
var mockResponse;
Eventer = function(){
events.EventEmitter.call(this);
this.data = '';
this.onData = function(){
this.emit('data', this.data);
}
this.setEncoding = function(){
}
this.onEnd = function(data){
this.emit('end', this.data);
}
};
util.inherits(Eventer, events.EventEmitter);
mockResponse = new Eventer();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment