8000 0.8 compatibility · yanxi123-com/log4js-node@2f44dbf · GitHub
[go: up one dir, main page]

Skip to content

Commit 2f44dbf

Browse files
committed
0.8 compatibility
1 parent 9da158f commit 2f44dbf

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

test/connect-logger-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ function MockRequest(remoteAddr, method, originalUrl, headers) {
4141
function MockResponse() {
4242
var r = this;
4343
this.end = function(chunk, encoding) {
44-
setImmediate(function(){ r.emit('finish') });
44+
r.emit('finish');
4545
};
4646

4747
this.writeHead = function(code, headers) {

test/nolog-test.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ function MockResponse(statusCode) {
3737
this.statusCode = statusCode;
3838

3939
this.end = function(chunk, encoding) {
40-
setImmediate(function(){ r.emit('finish') });
40+
r.emit('finish');
4141
};
4242
}
4343
util.inherits(MockResponse, EE);
@@ -87,9 +87,12 @@ vows.describe('log4js connect logger').addBatch({
8787
topic: function(d) {
8888
var req = new MockRequest('my.remote.addr', 'GET', 'http://url/hoge.gif'); // gif
8989
var res = new MockResponse(200);
90+
var cb = this.callback;
9091
d.cl(req, res, function() { });
9192
res.end('chunk', 'encoding');
92-
return d.ml.messages;
93+
setTimeout(function() {
94+
cb(null, d.ml.messages);
95+
},10);
9396
},
9497
'check message': function(messages) {
9598
assert.isArray(messages);

0 commit comments

Comments
 (0)
0