more tests, simplified the standard tests for the loggers
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
* Simple Mock of the http.IncommingMessage. Just implmenents the methods the methods
|
||||
* we use
|
||||
*
|
||||
* @type {[type]}
|
||||
* @type {Constuctor}
|
||||
*/
|
||||
module.exports = MockIncommingMessage;
|
||||
|
||||
|
||||
22
test/mocks/old_writable_stream.js
Normal file
22
test/mocks/old_writable_stream.js
Normal file
@ -0,0 +1,22 @@
|
||||
/**
|
||||
* Just a buffer really, but one that implements just a few methods similar
|
||||
* to the old writable streams, but without the same internals as streams 2.0
|
||||
* Writables.
|
||||
*
|
||||
* @type {Constuctor}
|
||||
*/
|
||||
module.exports = MockOldWritableStream;
|
||||
|
||||
var util = require('util');
|
||||
|
||||
function MockOldWritableStream(opts) {
|
||||
var queue = [];
|
||||
|
||||
this.write = function (chunk) {
|
||||
queue.push(chunk);
|
||||
};
|
||||
|
||||
this.end = function () {
|
||||
queue.push(null);
|
||||
};
|
||||
}
|
||||
@ -1,3 +1,8 @@
|
||||
/**
|
||||
* Extended version of http.ClientRequest with a few methods stubbed
|
||||
*
|
||||
* @type {Constructor}
|
||||
*/
|
||||
module.exports = MockRequest;
|
||||
|
||||
var sinon = require('sinon');
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/**
|
||||
* Just a buffer really, but one that implements the Writeable class
|
||||
* @type {WritableStream}
|
||||
* @type {Constuctor}
|
||||
*/
|
||||
module.exports = MockWritableStream;
|
||||
|
||||
@ -10,9 +10,7 @@ var util = require('util');
|
||||
function MockWritableStream(opts) {
|
||||
Writable.call(this, opts);
|
||||
|
||||
this._write = function (chunk, encoding, cb) {
|
||||
|
||||
};
|
||||
this._write = function (chunk, encoding, cb) {};
|
||||
}
|
||||
|
||||
util.inherits(MockWritableStream, Writable);
|
||||
|
||||
Reference in New Issue
Block a user