Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Avatar for KuCalc : devops.
Download
50675 views
1
/*
2
* console-test.js: Tests for instances of the Console transport
3
*
4
* (C) 2010 Charlie Robbins
5
* MIT LICENSE
6
*
7
*/
8
9
var path = require('path'),
10
vows = require('vows'),
11
assert = require('assert'),
12
winston = require('../../lib/winston'),
13
helpers = require('../helpers');
14
15
var npmTransport = new (winston.transports.Console)(),
16
syslogTransport = new (winston.transports.Console)({ levels: winston.config.syslog.levels });
17
18
vows.describe('winston/transports/console').addBatch({
19
"An instance of the Console Transport": {
20
"with npm levels": {
21
"should have the proper methods defined": function () {
22
helpers.assertConsole(npmTransport);
23
},
24
"the log() method": helpers.testNpmLevels(npmTransport, "should respond with true", function (ign, err, logged) {
25
assert.isNull(err);
26
assert.isTrue(logged);
27
})
28
},
29
"with syslog levels": {
30
"should have the proper methods defined": function () {
31
helpers.assertConsole(syslogTransport);
32
},
33
"the log() method": helpers.testSyslogLevels(syslogTransport, "should respond with true", function (ign, err, logged) {
34
assert.isNull(err);
35
assert.isTrue(logged);
36
})
37
}
38
}
39
}).export(module);
40