discord-baymax-bot/node_modules/log4js/test/tape/stdoutAppender-test.js
2017-03-23 23:52:08 -05:00

23 lines
601 B
JavaScript

"use strict";
var test = require('tape')
, layouts = require('../../lib/layouts')
, sandbox = require('sandboxed-module');
test('stdout appender', function(t) {
var output = []
, appender = sandbox.require(
'../../lib/appenders/stdout',
{
globals: {
process: { stdout: { write : function(data) { output.push(data); } } }
}
}
).appender(layouts.messagePassThroughLayout);
appender({ data: ["cheese"] });
t.plan(2);
t.equal(output.length, 1, 'There should be one message.');
t.equal(output[0], 'cheese\n', 'The message should be cheese.');
t.end();
});