fixing some lint issues

This commit is contained in:
Gareth Jones
2013-08-29 16:56:40 +10:00
parent 46ad57b4e0
commit 5e144e4004
17 changed files with 181 additions and 123 deletions
+40 -35
View File
@@ -76,22 +76,19 @@ describe('log4js layouts', function() {
});
it('should print the stacks of a passed error objects', function() {
assert.ok(
Array.isArray(
layout({
data: [ new Error() ],
startTime: new Date(2010, 11, 5, 14, 18, 30, 45),
category: "cheese",
level: {
colour: "green",
toString: function() { return "ERROR"; }
}
}).match(
/Error\s+at Context\..*\s+\((.*)test[\\\/]layouts-test\.js\:\d+\:\d+\)\s/
)
),
'regexp did not return a match'
);
assert.ok(Array.isArray(
layout({
data: [ new Error() ],
startTime: new Date(2010, 11, 5, 14, 18, 30, 45),
category: "cheese",
level: {
colour: "green",
toString: function() { return "ERROR"; }
}
}).match(
/Error\s+at Context\..*\s+\((.*)test[\\\/]layouts-test\.js\:\d+\:\d+\)\s/
)
), 'regexp did not return a match');
});
describe('with passed augmented errors', function() {
@@ -203,7 +200,13 @@ describe('log4js layouts', function() {
event.startTime.getTimezoneOffset = function() { return 0; };
it('should default to "time logLevel loggerName - message"', function() {
test(layout, event, tokens, null, "14:18:30 DEBUG multiple.levels.of.tests - this is a test\n");
test(
layout,
event,
tokens,
null,
"14:18:30 DEBUG multiple.levels.of.tests - this is a test\n"
);
});
it('%r should output time only', function() {
@@ -295,24 +298,26 @@ describe('log4js layouts', function() {
test(layout, event, tokens, '%[%r%]', '\x1B[36m14:18:30\x1B[39m');
});
it('%x{testString} should output the string stored in tokens', function() {
test(layout, event, tokens, '%x{testString}', 'testStringToken');
});
it('%x{testFunction} should output the result of the function stored in tokens', function() {
test(layout, event, tokens, '%x{testFunction}', 'testFunctionToken');
});
it('%x{doesNotExist} should output the string stored in tokens', function() {
test(layout, event, tokens, '%x{doesNotExist}', '%x{doesNotExist}');
});
it('%x{fnThatUsesLogEvent} should be able to use the logEvent', function() {
test(layout, event, tokens, '%x{fnThatUsesLogEvent}', 'DEBUG');
});
it('%x should output the string stored in tokens', function() {
test(layout, event, tokens, '%x', '%x');
describe('%x{}', function() {
it('%x{testString} should output the string stored in tokens', function() {
test(layout, event, tokens, '%x{testString}', 'testStringToken');
});
it('%x{testFunction} should output the result of the function stored in tokens', function() {
test(layout, event, tokens, '%x{testFunction}', 'testFunctionToken');
});
it('%x{doesNotExist} should output the string stored in tokens', function() {
test(layout, event, tokens, '%x{doesNotExist}', '%x{doesNotExist}');
});
it('%x{fnThatUsesLogEvent} should be able to use the logEvent', function() {
test(layout, event, tokens, '%x{fnThatUsesLogEvent}', 'DEBUG');
});
it('%x should output the string stored in tokens', function() {
test(layout, event, tokens, '%x', '%x');
});
});
});