ba290f0255c31aa9c81c999270a7041fe606e1f8.svn-base
1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*
* 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);