4
4
* @group unit/metrics/middleware
5
5
*/
6
6
7
- import { Metrics , MetricUnits , logMetrics , MetricResolution } from '../../../../metrics/src' ;
8
- import middy from '@middy/core' ;
7
+ import {
8
+ Metrics ,
9
+ MetricUnits ,
10
+ logMetrics ,
11
+ MetricResolution
12
+ } from '../../../../metrics/src' ; import middy from '@middy/core' ;
9
13
import { ExtraOptions } from '../../../src/types' ;
10
14
11
15
const consoleSpy = jest . spyOn ( console , 'log' ) . mockImplementation ( ) ;
@@ -315,8 +319,9 @@ describe('Middy middleware', () => {
315
319
) ;
316
320
} ) ;
317
321
} ) ;
318
- describe ( 'Feature: Resolution of Metrics' , ( ) => {
319
- test ( 'Should use metric resolution `Standard, 60` if `Standard` is set' , async ( ) => {
322
+ describe ( 'Metrics resolution' , ( ) => {
323
+
324
+ test ( 'should use metric resolution `Standard, 60` if `Standard` is set' , async ( ) => {
320
325
// Prepare
321
326
const metrics = new Metrics ( { namespace : 'serverlessAirline' , serviceName : 'orders' } ) ;
322
327
@@ -338,7 +343,11 @@ describe('Middy middleware', () => {
338
343
{
339
344
Namespace : 'serverlessAirline' ,
340
345
Dimensions : [ [ 'service' ] ] ,
341
- Metrics : [ { Name : 'successfulBooking' , Unit : 'Count' , StorageResolution : 60 } ] ,
346
+ Metrics : [ {
347
+ Name : 'successfulBooking' ,
348
+ Unit : 'Count' ,
349
+ StorageResolution : 60 ,
350
+ } ] ,
342
351
} ,
343
352
] ,
344
353
} ,
@@ -347,7 +356,8 @@ describe('Middy middleware', () => {
347
356
} )
348
357
) ;
349
358
} ) ;
350
- test ( 'Should use metric resolution `High, 1` if `High` is set' , async ( ) => {
359
+
360
+ test ( 'should use metric resolution `High, 1` if `High` is set' , async ( ) => {
351
361
// Prepare
352
362
const metrics = new Metrics ( { namespace : 'serverlessAirline' , serviceName : 'orders' } ) ;
353
363
@@ -369,7 +379,11 @@ describe('Middy middleware', () => {
369
379
{
370
380
Namespace : 'serverlessAirline' ,
371
381
Dimensions : [ [ 'service' ] ] ,
372
- Metrics : [ { Name : 'successfulBooking' , Unit : 'Count' , StorageResolution : 1 } ] ,
382
+ Metrics : [ {
383
+ Name : 'successfulBooking' ,
384
+ Unit : 'Count' ,
385
+ StorageResolution : 1
386
+ } ] ,
373
387
} ,
374
388
] ,
375
389
} ,
0 commit comments