1- 'use strict' ;
2-
31const { Logger } = require ( './logger' ) ;
42const { jsonFormatter } = require ( '../formatter/json' ) ;
53const { consoleOutput } = require ( '../output/console' ) ;
64
75describe ( 'Logger' , function ( ) {
86 let logger ;
9- let outputStub ;
107
118 beforeEach ( function ( ) {
129 logger = new Logger ( 'mongo' , true ) ;
13- outputStub = this . sandbox . stub ( Logger . config , 'output' ) ;
10+ this . sandbox . stub ( Logger . config , 'output' ) ;
1411 } ) ;
1512
1613 afterEach ( function ( ) {
@@ -214,20 +211,20 @@ describe('Logger', function() {
214211 expect ( logArguments . error_data . length ) . to . eql ( 3004 ) ;
215212 } ) ;
216213
217- describe ( 'when not an Error instance is passed as error' , function ( ) {
214+ describe ( 'when not an Error instance is passed as error' , function ( ) {
218215 [
219216 { type : 'custom object' , value : { } } ,
220217 { type : 'string' , value : 'error' } ,
221218 { type : 'null' , value : null } ,
222219 { type : 'number' , value : 12 } ,
223220 { type : 'bool' , value : true }
224221 ] . forEach ( ( { type, value } ) => {
225- it ( `should not throw error when ${ type } is passed as error` , function ( ) {
222+ it ( `should not throw error when ${ type } is passed as error` , function ( ) {
226223 expect ( ( ) => logger . customError ( 'error' , 'hi' , value , { details : 'here' } ) ) . to . not . throw ( ) ;
227224 } ) ;
228225 } ) ;
229226
230- it ( 'should log error properties from custom error object' , function ( ) {
227+ it ( 'should log error properties from custom error object' , function ( ) {
231228 const errorObject = { name : 'Error' , message : 'My custom error' , stack : 'Stack' , data : { value : 1 } } ;
232229
233230 logger . customError ( 'error' , 'hi' , errorObject , { details : 'here' } ) ;
@@ -240,7 +237,7 @@ describe('Logger', function() {
240237 expect ( logArguments . error_data ) . to . eql ( JSON . stringify ( errorObject . data ) ) ;
241238 } ) ;
242239
243- it ( 'should not log additional or missing error properties from custom error object' , function ( ) {
240+ it ( 'should not log additional or missing error properties from custom error object' , function ( ) {
244241 const errorObject = { color : 'color' , value : 'value' } ;
245242
246243 logger . customError ( 'error' , 'hi' , errorObject , { details : 'here' } ) ;
0 commit comments