@@ -356,31 +356,31 @@ describe('class MongoLogger', function () {
356
356
context : string ;
357
357
outcome : string ;
358
358
} > = [
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
+ ] ;
384
384
385
385
for ( const { input, outcome, expected, context : _context } of tests ) {
386
386
context ( _context , ( ) => {
@@ -613,21 +613,22 @@ describe('class MongoLogger', function () {
613
613
context ( 'when mongodbLogPath is set to valid client option' , function ( ) {
614
614
for ( const validEnvironmentOption of validEnvironmentOptions ) {
615
615
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
+ } ) ;
631
632
}
632
633
}
633
634
} ) ;
@@ -1120,10 +1121,10 @@ describe('class MongoLogger', function () {
1120
1121
const event =
1121
1122
reason === 'connectionError'
1122
1123
? {
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
+ }
1127
1128
: { ...connectionCheckOutFailed , reason } ;
1128
1129
logger [ severityLevel ] ( 'connection' , event ) ;
1129
1130
expect ( stream . buffer ) . to . have . lengthOf ( 1 ) ;
@@ -1561,9 +1562,9 @@ describe('class MongoLogger', function () {
1561
1562
component === value
1562
1563
? ( severities [ component ] = severityLevel )
1563
1564
: ( severities [ value ] =
1564
- severityLevels [ index + 1 ] === 'off'
1565
- ? severityLevel
1566
- : severityLevels [ index + 1 ] ) ;
1565
+ severityLevels [ index + 1 ] === 'off'
1566
+ ? severityLevel
1567
+ : severityLevels [ index + 1 ] ) ;
1567
1568
return severities ;
1568
1569
} , { } ) ;
1569
1570
logger = new MongoLogger ( {
0 commit comments