discord-baymax-bot/node_modules/log4js/test/tape/stderrAppender-test.js

23 lines
607 B
JavaScript
Raw Permalink Normal View History

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