migrated tests to mocha
This commit is contained in:
@@ -17,5 +17,4 @@ function configure(config) {
|
|||||||
return consoleAppender(layout);
|
return consoleAppender(layout);
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.appender = consoleAppender;
|
|
||||||
exports.configure = configure;
|
exports.configure = configure;
|
||||||
|
|||||||
@@ -1,33 +1,31 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
var assert = require('assert')
|
var should = require('should')
|
||||||
, vows = require('vows')
|
|
||||||
, layouts = require('../lib/layouts')
|
|
||||||
, sandbox = require('sandboxed-module');
|
, sandbox = require('sandboxed-module');
|
||||||
|
|
||||||
vows.describe('../lib/appenders/console').addBatch({
|
describe('../lib/appenders/console', function() {
|
||||||
'appender': {
|
var messages = [];
|
||||||
topic: function() {
|
|
||||||
var messages = []
|
|
||||||
, fakeConsole = {
|
|
||||||
log: function(msg) { messages.push(msg); }
|
|
||||||
}
|
|
||||||
, appenderModule = sandbox.require(
|
|
||||||
'../lib/appenders/console',
|
|
||||||
{
|
|
||||||
globals: {
|
|
||||||
'console': fakeConsole
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
|
||||||
, appender = appenderModule.appender(layouts.messagePassThroughLayout);
|
|
||||||
|
|
||||||
appender({ data: ["blah"] });
|
before(function() {
|
||||||
return messages;
|
var fakeConsole = {
|
||||||
},
|
log: function(msg) { messages.push(msg); }
|
||||||
|
|
||||||
'should output to console': function(messages) {
|
|
||||||
assert.equal(messages[0], 'blah');
|
|
||||||
}
|
}
|
||||||
}
|
, appenderModule = sandbox.require(
|
||||||
|
'../lib/appenders/console',
|
||||||
|
{
|
||||||
|
globals: {
|
||||||
|
'console': fakeConsole
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
, appender = appenderModule.configure(
|
||||||
|
{ layout: { type: "messagePassThrough" } }
|
||||||
|
);
|
||||||
|
|
||||||
}).exportTo(module);
|
appender({ data: ["blah"] });
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should output to console', function() {
|
||||||
|
messages.should.eql(["blah"]);
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user