8000 Add test for amount of exit listeners in FA · Web5design/log4js-node@3f10b68 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3f10b68

Browse files
committed
Add test for amount of exit listeners in FA
1 parent 54c3118 commit 3f10b68

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

test/fileAppender-test.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,24 @@ function remove(filename) {
1515
}
1616

1717
vows.describe('log4js fileAppender').addBatch({
18+
'adding multiple fileAppenders': {
19+
topic: function () {
20+
var listenersCount = process.listeners('exit').length
21+
, logger = log4js.getLogger('default-settings')
22+
, count = 5, logfile;
23+
24+
while (count--) {
25+
logfile = path.join(__dirname, '/fa-default-test' + count + '.log');
26+
log4js.addAppender(require('../lib/appenders/file').appender(logfile), 'default-settings');
27+
}
28+
29+
return listenersCount;
30+
},
31+
32+
'does not adds more than one `exit` listeners': function (initialCount) {
33+
assert.ok(process.listeners('exit').length <= initialCount + 1);
34+
}
35+
},
1836

1937
'with default fileAppender settings': {
2038
topic: function() {

0 commit comments

Comments
 (0)
0