mirror of
https://github.com/seejohnrun/haste-server.git
synced 2024-11-01 11:31:22 +00:00
39 lines
1.2 KiB
JavaScript
39 lines
1.2 KiB
JavaScript
|
/*
|
||
|
* console-test.js: Tests for instances of the Console transport
|
||
|
*
|
||
|
* (C) 2010 Charlie Robbins
|
||
|
* MIT LICENSE
|
||
|
*
|
||
|
*/
|
||
|
|
||
|
var path = require('path'),
|
||
|
vows = require('vows'),
|
||
|
assert = require('assert'),
|
||
|
winston = require('../../lib/winston'),
|
||
|
helpers = require('../helpers');
|
||
|
|
||
|
var npmTransport = new (winston.transports.Console)(),
|
||
|
syslogTransport = new (winston.transports.Console)({ levels: winston.config.syslog.levels });
|
||
|
|
||
|
vows.describe('winston/transports/console').addBatch({
|
||
|
"An instance of the Console Transport": {
|
||
|
"with npm levels": {
|
||
|
"should have the proper methods defined": function () {
|
||
|
helpers.assertConsole(npmTransport);
|
||
|
},
|
||
|
"the log() method": helpers.testNpmLevels(npmTransport, "should respond with true", function (ign, err, logged) {
|
||
|
assert.isNull(err);
|
||
|
assert.isTrue(logged);
|
||
|
})
|
||
|
},
|
||
|
"with syslog levels": {
|
||
|
"should have the proper methods defined": function () {
|
||
|
helpers.assertConsole(syslogTransport);
|
||
|
},
|
||
|
"the log() method": helpers.testSyslogLevels(syslogTransport, "should respond with true", function (ign, err, logged) {
|
||
|
assert.isNull(err);
|
||
|
assert.isTrue(logged);
|
||
|
})
|
||
|
}
|
||
|
}
|
||
|
}).export(module);
|