Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Avatar for KuCalc : devops.
Download
50659 views
1
/*
2
* cli-test.js: Tests for the cli levels available in winston.
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
vows.describe('winston/logger/cli').addBatch({
16
"When an instance of winston.Logger": {
17
topic: function () {
18
return new winston.Logger({
19
transports: [
20
new winston.transports.Console()
21
]
22
})
23
},
24
"the cli() method": {
25
"should set the appropriate values on the logger": function (logger) {
26
logger.cli();
27
assert.isTrue(logger.padLevels);
28
assert.isTrue(logger.transports.console.colorize);
29
assert.isFalse(logger.transports.console.timestamp);
30
Object.keys(winston.config.cli.levels).forEach(function (level) {
31
assert.isNumber(logger.levels[level]);
32
});
33
34
Object.keys(winston.config.cli.colors).forEach(function (color) {
35
assert.isString(winston.config.allColors[color]);
36
});
37
}
38
}
39
}
40
}).export(module);
41