mirror of
https://github.com/log4js-node/log4js-node.git
synced 2025-12-08 19:26:01 +00:00
32 lines
678 B
JavaScript
32 lines
678 B
JavaScript
"use strict";
|
|
var should = require('should')
|
|
, sandbox = require('sandboxed-module');
|
|
|
|
describe('../lib/appenders/console', function() {
|
|
var messages = [];
|
|
|
|
before(function() {
|
|
var fakeConsole = {
|
|
log: function(msg) { messages.push(msg); }
|
|
}
|
|
, appenderModule = sandbox.require(
|
|
'../lib/appenders/console',
|
|
{
|
|
globals: {
|
|
'console': fakeConsole
|
|
}
|
|
}
|
|
)
|
|
, appender = appenderModule(require('../lib/layouts'))(
|
|
{ layout: { type: "messagePassThrough" } }
|
|
);
|
|
|
|
appender({ data: ["blah"] });
|
|
});
|
|
|
|
it('should output to console', function() {
|
|
messages.should.eql(["blah"]);
|
|
});
|
|
|
|
});
|