@@ -356,31 +356,31 @@ describe('class MongoLogger', function () {
356356 context : string ;
357357 outcome : string ;
358358 } > = [
359- {
360- input : undefined ,
361- expected : 1000 ,
362- context : 'when unset' ,
363- outcome : 'defaults to 1000'
364- } ,
365- {
366- input : '33' ,
367- context : 'when set to parsable uint' ,
368- outcome : 'sets `maxDocumentLength` to the parsed value' ,
369- expected : 33
370- } ,
371- {
372- input : '' ,
373- context : 'when set to an empty string' ,
374- outcome : 'defaults to 1000' ,
375- expected : 1000
376- } ,
377- {
378- input : 'asdf' ,
379- context : 'when set to a non-integer string' ,
380- outcome : 'defaults to 1000' ,
381- expected : 1000
382- }
383- ] ;
359+ {
360+ input : undefined ,
361+ expected : 1000 ,
362+ context : 'when unset' ,
363+ outcome : 'defaults to 1000'
364+ } ,
365+ {
366+ input : '33' ,
367+ context : 'when set to parsable uint' ,
368+ outcome : 'sets `maxDocumentLength` to the parsed value' ,
369+ expected : 33
370+ } ,
371+ {
372+ input : '' ,
373+ context : 'when set to an empty string' ,
374+ outcome : 'defaults to 1000' ,
375+ expected : 1000
376+ } ,
377+ {
378+ input : 'asdf' ,
379+ context : 'when set to a non-integer string' ,
380+ outcome : 'defaults to 1000' ,
381+ expected : 1000
382+ }
383+ ] ;
384384
385385 for ( const { input, outcome, expected, context : _context } of tests ) {
386386 context ( _context , ( ) => {
@@ -613,21 +613,22 @@ describe('class MongoLogger', function () {
613613 context ( 'when mongodbLogPath is set to valid client option' , function ( ) {
614614 for ( const validEnvironmentOption of validEnvironmentOptions ) {
615615 for ( const validValue of validClientOptions ) {
616- it ( `{environment: "${ validEnvironmentOption } ", client: ${ typeof validValue === 'object'
617- ? 'new ' + validValue . constructor . name + '(...)'
618- : '"' + validValue . toString ( ) + '"'
619- } } uses the value from the client options`, function ( ) {
620- const options = MongoLogger . resolveOptions (
621- {
622- MONGODB_LOG_PATH : validEnvironmentOption ,
623- MONGODB_LOG_COMMAND : 'error'
624- } ,
625- { mongodbLogPath : validValue as any }
626- ) ;
627- const correctDestination = validOptions . get ( validValue ) ;
628- options . logDestination . write ( { t : new Date ( ) , c : 'command' , s : 'error' } ) ;
629- expect ( correctDestination ?. write ) . to . have . been . calledOnce ;
630- } ) ;
616+ it ( `{environment: "${ validEnvironmentOption } ", client: ${
617+ typeof validValue === 'object'
618+ ? 'new ' + validValue . constructor . name + '(...)'
619+ : '"' + validValue . toString ( ) + '"'
620+ } } uses the value from the client options`, function ( ) {
621+ const options = MongoLogger . resolveOptions (
622+ {
623+ MONGODB_LOG_PATH : validEnvironmentOption ,
624+ MONGODB_LOG_COMMAND : 'error'
625+ } ,
626+ { mongodbLogPath : validValue as any }
627+ ) ;
628+ const correctDestination = validOptions . get ( validValue ) ;
629+ options . logDestination . write ( { t : new Date ( ) , c : 'command' , s : 'error' } ) ;
630+ expect ( correctDestination ?. write ) . to . have . been . calledOnce ;
631+ } ) ;
631632 }
632633 }
633634 } ) ;
@@ -1120,10 +1121,10 @@ describe('class MongoLogger', function () {
11201121 const event =
11211122 reason === 'connectionError'
11221123 ? {
1123- ...connectionCheckOutFailed ,
1124- reason,
1125- error : new Error ( 'this is an error' )
1126- }
1124+ ...connectionCheckOutFailed ,
1125+ reason,
1126+ error : new Error ( 'this is an error' )
1127+ }
11271128 : { ...connectionCheckOutFailed , reason } ;
11281129 logger [ severityLevel ] ( 'connection' , event ) ;
11291130 expect ( stream . buffer ) . to . have . lengthOf ( 1 ) ;
@@ -1561,9 +1562,9 @@ describe('class MongoLogger', function () {
15611562 component === value
15621563 ? ( severities [ component ] = severityLevel )
15631564 : ( severities [ value ] =
1564- severityLevels [ index + 1 ] === 'off'
1565- ? severityLevel
1566- : severityLevels [ index + 1 ] ) ;
1565+ severityLevels [ index + 1 ] === 'off'
1566+ ? severityLevel
1567+ : severityLevels [ index + 1 ] ) ;
15671568 return severities ;
15681569 } , { } ) ;
15691570 logger = new MongoLogger ( {
0 commit comments