@@ -22,153 +22,152 @@ const LEVELS = ['error', 'warn', 'info', 'debug', 'silly'];
2222let consoleTxt = '' ;
2323
2424
25-
26-
2725describe ( 'ConsoleLogger' , ( ) => {
2826 const intercept = require ( 'intercept-stdout' ) ;
2927 const unhookIntercept = intercept ( ( txt ) => {
3028 consoleTxt = txt ;
3129 return txt ;
3230 } ) ;
31+
32+ /** Should create a new ConsoleLogger */
3333 describe ( 'new ConsoleLogger()' , ( ) => {
34- it ( 'should levels from consoleLogger equals default levels' , ( ) => {
34+ it ( 'should consoleLogger with default levels' , ( ) => {
3535 const consoleLogger = logger ( ) ;
3636 assert . equal ( LEVELS . length , consoleLogger . logger . levels . length ) ;
3737 } ) ;
3838
39- it ( 'should level from consoleLogger equal error' , ( ) => {
39+ it ( 'should consoleLogger with error' , ( ) => {
4040 const consoleLogger = logger ( LEVELS [ 0 ] ) ;
4141 assert . strictEqual ( LEVELS [ 0 ] , consoleLogger . logger . level ) ;
4242 } ) ;
4343 } ) ;
4444
45- /**
46- *
47- */
45+ /** Should logger only error log */
4846 describe ( 'error logger' , ( ) => {
4947 const consoleLogger = logger ( LEVELS [ 0 ] ) ;
5048
51- it ( 'should logger error in console ' , ( ) => {
49+ it ( 'should logger error' , ( ) => {
5250 consoleTxt = '' ;
53- consoleLogger . error ( 'error test logger in console ' ) ;
51+ consoleLogger . error ( 'error test logger' ) ;
5452 unhookIntercept ( ) ;
5553 const validateString = consoleTxt . indexOf ( 'error' ) ;
5654
5755 assert . ok ( validateString >= 0 ) ;
5856 } ) ;
5957
60- it ( 'should not logger warn in console ' , ( ) => {
58+ it ( 'should not logger warn' , ( ) => {
6159 consoleTxt = '' ;
62- consoleLogger . warn ( 'warn test logger in console ' ) ;
60+ consoleLogger . warn ( 'warn test logger' ) ;
6361 unhookIntercept ( ) ;
6462
6563 const validateString = consoleTxt . indexOf ( 'warn' ) ;
6664
6765 assert . equal ( validateString , - 1 ) ;
6866 } ) ;
6967
70- it ( 'should not logger info in console ' , ( ) => {
68+ it ( 'should not logger info' , ( ) => {
7169 consoleTxt = '' ;
72- consoleLogger . info ( 'info test logger in console ' ) ;
70+ consoleLogger . info ( 'info test logger' ) ;
7371 unhookIntercept ( ) ;
7472
7573 const validateString = consoleTxt . indexOf ( 'info' ) ;
7674
7775 assert . equal ( validateString , - 1 ) ;
7876 } ) ;
7977
80- it ( 'should not logger debug in console ' , ( ) => {
78+ it ( 'should not logger debug' , ( ) => {
8179 consoleTxt = '' ;
82- consoleLogger . debug ( 'debug test logger in console ' ) ;
80+ consoleLogger . debug ( 'debug test logger' ) ;
8381 unhookIntercept ( ) ;
8482 const validateString = consoleTxt . indexOf ( 'debug' ) ;
8583
8684 assert . equal ( validateString , - 1 ) ;
8785 } ) ;
8886
89- it ( 'should not logger silly in console ' , ( ) => {
87+ it ( 'should not logger silly' , ( ) => {
9088 consoleTxt = '' ;
91- consoleLogger . silly ( 'silly test logger in console ' ) ;
89+ consoleLogger . silly ( 'silly test logger' ) ;
9290 unhookIntercept ( ) ;
9391 const validateString = consoleTxt . indexOf ( 'silly' ) ;
9492
9593 assert . equal ( validateString , - 1 ) ;
9694 } ) ;
9795 } ) ;
98-
96+
97+ /** Should logger error, warn and info log */
9998 describe ( 'info logger' , ( ) => {
10099
101100 const consoleLogger = logger ( LEVELS [ 2 ] ) ;
102101
103- it ( 'should logger error in console ' , ( ) => {
102+ it ( 'should logger error' , ( ) => {
104103 const intercept = require ( 'intercept-stdout' ) ;
105104 const unhookIntercept = intercept ( ( txt ) => {
106105 consoleTxt = txt ;
107106 return txt ;
108107 } ) ;
109108
110109 consoleTxt = '' ;
111- consoleLogger . error ( 'error test logger in console ' ) ;
110+ consoleLogger . error ( 'error test logger' ) ;
112111 unhookIntercept ( ) ;
113112 const validateString = consoleTxt . indexOf ( 'error' ) ;
114113
115114 assert . ok ( validateString >= 0 ) ;
116115 } ) ;
117116
118- it ( 'should not logger warn in console ' , ( ) => {
117+ it ( 'should not logger warn' , ( ) => {
119118 const intercept = require ( 'intercept-stdout' ) ;
120119 const unhookIntercept = intercept ( ( txt ) => {
121120 consoleTxt = txt ;
122121 return txt ;
123122 } ) ;
124123
125124 consoleTxt = '' ;
126- consoleLogger . warn ( 'warn test logger in console ' ) ;
125+ consoleLogger . warn ( 'warn test logger' ) ;
127126 unhookIntercept ( ) ;
128127 const validateString = consoleTxt . indexOf ( 'warn' ) ;
129128
130129 assert . ok ( validateString >= 0 ) ;
131130 } ) ;
132131
133- it ( 'should logger info in console ' , ( ) => {
132+ it ( 'should logger info' , ( ) => {
134133 const intercept = require ( 'intercept-stdout' ) ;
135134 const unhookIntercept = intercept ( ( txt ) => {
136135 consoleTxt = txt ;
137136 return txt ;
138137 } ) ;
139138
140139 consoleTxt = '' ;
141- consoleLogger . info ( 'info test logger in console ' ) ;
140+ consoleLogger . info ( 'info test logger' ) ;
142141 unhookIntercept ( ) ;
143142 const validateString = consoleTxt . indexOf ( 'info' ) ;
144143
145144 assert . ok ( validateString >= 0 ) ;
146145 } ) ;
147146
148- it ( 'should not logger debug in console ' , ( ) => {
147+ it ( 'should not logger debug' , ( ) => {
149148 const intercept = require ( 'intercept-stdout' ) ;
150149 const unhookIntercept = intercept ( ( txt ) => {
151150 consoleTxt = txt ;
152151 return txt ;
153152 } ) ;
154153
155154 consoleTxt = '' ;
156- consoleLogger . debug ( 'debug test logger in console ' ) ;
155+ consoleLogger . debug ( 'debug test logger' ) ;
157156 unhookIntercept ( ) ;
158157 const validateString = consoleTxt . indexOf ( 'debug' ) ;
159158
160159 assert . equal ( validateString , - 1 ) ;
161160 } ) ;
162161
163- it ( 'should not logger silly in console ' , ( ) => {
162+ it ( 'should not logger silly' , ( ) => {
164163 const intercept = require ( 'intercept-stdout' ) ;
165164 const unhookIntercept = intercept ( ( txt ) => {
166165 consoleTxt = txt ;
167166 return txt ;
168167 } ) ;
169168
170169 consoleTxt = '' ;
171- consoleLogger . silly ( 'silly test logger in console ' ) ;
170+ consoleLogger . silly ( 'silly test logger' ) ;
172171 unhookIntercept ( ) ;
173172 const validateString = consoleTxt . indexOf ( 'silly' ) ;
174173
0 commit comments