mirror of
https://github.com/log4js-node/log4js-node.git
synced 2025-12-08 19:26:01 +00:00
Merge pull request #1365 from log4js-node/update-test
test: improved test for fileAppender
This commit is contained in:
commit
7ebc9e0238
@ -435,16 +435,18 @@ test('log4js fileAppender', (batch) => {
|
||||
|
||||
t.test('should log when writer.writable=true', (assert) => {
|
||||
writable = true;
|
||||
assert.ok(output.length === 0);
|
||||
appender({ data: 'something to log' });
|
||||
assert.ok(output.length, 1);
|
||||
assert.ok(output.length === 1);
|
||||
assert.match(output[output.length - 1], 'something to log');
|
||||
assert.end();
|
||||
});
|
||||
|
||||
t.test('should not log when writer.writable=false', (assert) => {
|
||||
writable = false;
|
||||
assert.ok(output.length === 1);
|
||||
appender({ data: 'this should not be logged' });
|
||||
assert.ok(output.length, 1);
|
||||
assert.ok(output.length === 1);
|
||||
assert.notMatch(output[output.length - 1], 'this should not be logged');
|
||||
assert.end();
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user