From e84dc40991ce0da4b674d6da9491dc4580aa1bc8 Mon Sep 17 00:00:00 2001 From: Gareth Jones Date: Fri, 30 Dec 2016 19:51:35 +1100 Subject: [PATCH] fix(test): moved logFaces test to tap --- test/{vows => tap}/logFacesAppender-test.js | 67 ++++++++++----------- 1 file changed, 33 insertions(+), 34 deletions(-) rename test/{vows => tap}/logFacesAppender-test.js (61%) diff --git a/test/vows/logFacesAppender-test.js b/test/tap/logFacesAppender-test.js similarity index 61% rename from test/vows/logFacesAppender-test.js rename to test/tap/logFacesAppender-test.js index 03c3025..fe1a632 100644 --- a/test/vows/logFacesAppender-test.js +++ b/test/tap/logFacesAppender-test.js @@ -1,7 +1,6 @@ 'use strict'; -const vows = require('vows'); -const assert = require('assert'); +const test = require('tap').test; const log4js = require('../../lib/log4js'); function setupLogging(category, options) { @@ -26,20 +25,18 @@ function setupLogging(category, options) { }; } -vows.describe('logFaces appender').addBatch({ - 'when using HTTP receivers': { - topic: function () { - const setup = setupLogging('myCategory', { - type: 'logFacesAppender', - application: 'LFS-HTTP', - url: 'http://localhost/receivers/rx1' - }); +test('logFaces appender', (batch) => { + batch.test('when using HTTP receivers', (t) => { + const setup = setupLogging('myCategory', { + type: 'logFacesAppender', + application: 'LFS-HTTP', + url: 'http://localhost/receivers/rx1' + }); - setup.logger.warn('Log event #1'); - return setup; - }, - 'an event should be sent': function (topic) { - const event = topic.results; + setup.logger.warn('Log event #1'); + + t.test('an event should be sent', (assert) => { + const event = setup.results; assert.equal(event.a, 'LFS-HTTP'); assert.equal(event.m, 'Log event #1'); assert.equal(event.g, 'myCategory'); @@ -53,23 +50,23 @@ vows.describe('logFaces appender').addBatch({ date.toISOString().substring(0, 14), new Date().toISOString().substring(0, 14) ); - } - }, + assert.end(); + }); + t.end(); + }); - 'when using UDP receivers': { - topic: function () { - const setup = setupLogging('udpCategory', { - type: 'logFacesAppender', - application: 'LFS-UDP', - remoteHost: '127.0.0.1', - port: 55201 - }); + batch.test('when using UDP receivers', (t) => { + const setup = setupLogging('udpCategory', { + type: 'logFacesAppender', + application: 'LFS-UDP', + remoteHost: '127.0.0.1', + port: 55201 + }); - setup.logger.error('Log event #2'); - return setup; - }, - 'an event should be sent': function (topic) { - const event = topic.results; + setup.logger.error('Log event #2'); + + t.test('an event should be sent', (assert) => { + const event = setup.results; assert.equal(event.a, 'LFS-UDP'); assert.equal(event.m, 'Log event #2'); assert.equal(event.g, 'udpCategory'); @@ -83,8 +80,10 @@ vows.describe('logFaces appender').addBatch({ date.toISOString().substring(0, 14), new Date().toISOString().substring(0, 14) ); - } - } + assert.end(); + }); + t.end(); + }); - -}).export(module); + batch.end(); +});