more linting

This commit is contained in:
Gareth Jones 2013-05-26 17:21:39 +10:00
parent 6a9441d261
commit 2192a094b6

View File

@ -1,6 +1,8 @@
var vows = require('vows'),
sandbox = require('sandboxed-module'),
assert = require('assert');
"use strict";
var vows = require('vows')
, sandbox = require('sandboxed-module')
, assert = require('assert')
;
function makeFakeNet() {
return {
@ -67,11 +69,11 @@ vows.describe('Multiprocess Appender').addBatch({
//don't need a proper log event for the worker tests
appender('before connect');
fakeNet.cbs['connect']();
fakeNet.cbs.connect();
appender('after connect');
fakeNet.cbs['close'](true);
fakeNet.cbs.close(true);
appender('after error, before connect');
fakeNet.cbs['connect']();
fakeNet.cbs.connect();
appender('after error, after connect');
return fakeNet;
@ -112,13 +114,13 @@ vows.describe('Multiprocess Appender').addBatch({
//don't need a proper log event for the worker tests
appender('before connect');
fakeNet.cbs['connect']();
fakeNet.cbs.connect();
appender('after connect');
fakeNet.cbs['timeout']();
fakeNet.cbs.timeout();
appender('after timeout, before close');
fakeNet.cbs['close']();
fakeNet.cbs.close();
appender('after close, before connect');
fakeNet.cbs['connect']();
fakeNet.cbs.connect();
appender('after close, after connect');
return fakeNet;
@ -181,14 +183,27 @@ vows.describe('Multiprocess Appender').addBatch({
},
'when a client connects': {
topic: function(net) {
var logString = JSON.stringify({ level: { level: 10000, levelStr: 'DEBUG' }, data: ['some debug']}) + '__LOG4JS__';
var logString = JSON.stringify(
{ level: { level: 10000, levelStr: 'DEBUG' }
, data: ['some debug']}
) + '__LOG4JS__';
net.cbs['data'](JSON.stringify({ level: { level: 40000, levelStr: 'ERROR' }, data: ['an error message'] }) + '__LOG4JS__');
net.cbs['data'](logString.substring(0, 10));
net.cbs['data'](logString.substring(10));
net.cbs['data'](logString + logString + logString);
net.cbs['end'](JSON.stringify({ level: { level: 50000, levelStr: 'FATAL' }, data: ["that's all folks"] }) + '__LOG4JS__');
net.cbs['data']('bad message__LOG4JS__');
net.cbs.data(
JSON.stringify(
{ level: { level: 40000, levelStr: 'ERROR' }
, data: ['an error message'] }
) + '__LOG4JS__'
);
net.cbs.data(logString.substring(0, 10));
net.cbs.data(logString.substring(10));
net.cbs.data(logString + logString + logString);
net.cbs.end(
JSON.stringify(
{ level: { level: 50000, levelStr: 'FATAL' }
, data: ["that's all folks"] }
) + '__LOG4JS__'
);
net.cbs.data('bad message__LOG4JS__');
return net;
},
'should parse log messages into log events and send to appender': function(net) {