* switch from custom eslint config to standard + prettier * fix new standard eslint violations * add editorconfig file * auto-fix all other violations * update lint yarn script * remove jshint comment
36 lines
709 B
JavaScript
36 lines
709 B
JavaScript
/**
|
|
* Simple Mock of the http.IncommingMessage. Just implmenents the methods the methods
|
|
* we use
|
|
*
|
|
* @type {Constuctor}
|
|
*/
|
|
module.exports = MockIncommingMessage;
|
|
|
|
var sinon = require('sinon');
|
|
var util = require('util');
|
|
var Readable = require('stream').Readable;
|
|
|
|
if (!Readable) {
|
|
Readable = require('events').EventEmitter;
|
|
}
|
|
|
|
function MockIncommingMessage() {
|
|
Readable.call(this);
|
|
|
|
this.setEncoding = sinon.stub();
|
|
this.headers = {};
|
|
this._read = function() {};
|
|
}
|
|
util.inherits(MockIncommingMessage, Readable);
|
|
|
|
/**
|
|
* To make the message "talk" do something like this:
|
|
*
|
|
* process.nextTick(function () {
|
|
* if (resp) {
|
|
* incom.push(chunk);
|
|
* }
|
|
* incom.push(null);
|
|
* });
|
|
*/
|