Created
December 19, 2013 13:33
-
-
Save daithi-coombes/8039142 to your computer and use it in GitHub Desktop.
NodeJS Mock for http.serverResponse
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!#/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