fixing some lint issues
This commit is contained in:
+40
-35
@@ -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');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user