8000 fix(test): moved logFaces test to tap · WebHu/log4js-node@e84dc40 · GitHub
[go: up one dir, main page]

Skip to content

Commit e84dc40

Browse files
Gareth Jones
committed
fix(test): moved logFaces test to tap
1 parent 7d13b6e commit e84dc40

File tree

1 file changed

+33
-34
lines changed

1 file changed

+33
-34
lines changed
Lines changed: 33 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
'use strict';
22

3-
const vows = require('vows');
4-
const assert = require('assert');
3+
const test = require('tap').test;
54
const log4js = require('../../lib/log4js');
65

76
function setupLogging(category, options) {
@@ -26,20 +25,18 @@ function setupLogging(category, options) {
2625
};
2726
}
2827

29-
vows.describe('logFaces appender').addBatch({
30-
'when using HTTP receivers': {
31-
topic: function () {
32-
const setup = setupLogging('myCategory', {
33-
type: 'logFacesAppender',
34-
application: 'LFS-HTTP',
35-
url: 'http://localhost/receivers/rx1'
36-
});
28+
test('logFaces appender', (batch) => {
29+
batch.test('when using HTTP receivers', (t) => {
30+
const setup = setupLogging('myCategory', {
31+
type: 'logFacesAppender',
32+
application: 'LFS-HTTP',
33+
url: 'http://localhost/receivers/rx1'
34+
});
35+
36+
setup.logger.warn('Log event #1');
3737

38-
setup.logger.warn('Log event #1');
39-
return setup;
40-
},
41-
'an event should be sent': function (topic) {
42-
const event = topic.results;
38+
t.test('an event should be sent', (assert) => {
39+
const event = setup.results;
4340
assert.equal(event.a, 'LFS-HTTP');
4441
assert.equal(event.m, 'Log event #1');
4542
assert.equal(event.g, 'myCategory');
@@ -53,23 +50,23 @@ vows.describe('logFaces appender').addBatch({
5350
date.toISOString().substring(0, 14),
5451
new Date().toISOString().substring(0, 14)
5552
);
56-
}
57-
},
53+
assert.end();
54+
});
55+
t.end();
56+
});
57+
58+
batch.test('when using UDP receivers', (t) => {
59+
const setup = setupLogging('udpCategory', {
60+
type: 'logFacesAppender',
61+
application: 'LFS-UDP',
62+
remoteHost: '127.0.0.1',
63+
port: 55201
64+
});
5865

59-
'when using UDP receivers': {
60-
topic: function () {
61-
const setup = setupLogging('udpCategory', {
62-
type: 'logFacesAppender',
63-
application: 'LFS-UDP',
64-
remoteHost: '127.0.0.1',
65-
port: 55201
66-
});
66+
setup.logger.error('Log event #2');
6767

68-
setup.logger.error('Log event #2');
69-
return setup;
70-
},
71-
'an event should be sent': function (topic) {
72-
const event = topic.results;
68+
t.test('an event should be sent', (assert) => {
69+
const event = setup.results;
7370
assert.equal(event.a, 'LFS-UDP');
7471
assert.equal(event.m, 'Log event #2');
7572
assert.equal(event.g, 'udpCategory');
@@ -83,8 +80,10 @@ vows.describe('logFaces appender').addBatch({
8380
date.toISOString().substring(0, 14),
8481
new Date().toISOString().substring(0, 14)
8582
);
86-
}
87-
}
88-
83+
assert.end();
84+
});
85+
t.end();
86+
});
8987

90-
}).export(module);
88+
batch.end();
89+
});

0 commit comments

Comments
 (0)
0