File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
packages/metrics/tests/unit Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -332,12 +332,13 @@ describe('Working with dimensions', () => {
332
332
} ,
333
333
} ) ;
334
334
335
- // Act & Assess
336
- let i = 1 ;
335
+ // Act
337
336
// We start with 2 dimensions because the default dimension & service name are already added
338
- for ( i = 2 ; i < MAX_DIMENSION_COUNT ; i ++ ) {
337
+ for ( let i = 2 ; i < MAX_DIMENSION_COUNT ; i ++ ) {
339
338
metrics . addDimension ( `dimension-${ i } ` , 'test' ) ;
340
339
}
340
+
341
+ // Assess
341
342
expect ( ( ) => metrics . addDimension ( 'extra' , 'test' ) ) . toThrowError (
342
343
`The number of metric dimensions must be lower than ${ MAX_DIMENSION_COUNT } `
343
344
) ;
@@ -354,6 +355,8 @@ describe('Working with dimensions', () => {
354
355
for ( let i = 1 ; i < MAX_DIMENSION_COUNT - 1 ; i ++ ) {
355
356
metrics . setDefaultDimensions ( { [ `dimension-${ i } ` ] : 'test' } ) ;
356
357
}
358
+
359
+ // Assess
357
360
expect ( ( ) => metrics . setDefaultDimensions ( { extra : 'test' } ) ) . toThrowError (
358
361
'Max dimension count hit'
359
362
) ;
@@ -368,13 +371,13 @@ describe('Working with dimensions', () => {
368
371
} ,
369
372
} ) ;
370
373
371
- // Act & Assess
372
- let i = 1 ;
374
+ // Act
373
375
// We start with 2 dimensions because the default dimension & service name are already added
374
- for ( i = 2 ; i < MAX_DIMENSION_COUNT - 2 ; i ++ ) {
376
+ for ( let i = 2 ; i < MAX_DIMENSION_COUNT ; i ++ ) {
375
377
metrics . addDimension ( `dimension-${ i } ` , 'test' ) ;
376
378
}
377
379
380
+ // Assess
378
381
// Adding a dimension set with 3 dimensions would exceed the limit
379
382
expect ( ( ) =>
380
383
metrics . addDimensions ( {
You can’t perform that action at this time.
0 commit comments