File tree Expand file tree Collapse file tree 2 files changed +2
-23
lines changed Expand file tree Collapse file tree 2 files changed +2
-23
lines changed Original file line number Diff line number Diff line change @@ -760,9 +760,9 @@ class Metrics extends Utility implements MetricsInterface {
760
760
* - `POWERTOOLS_FUNCTION_NAME` environment variable
761
761
* - {@link Metrics.captureColdStartMetric | `captureColdStartMetric('myFunctionName')`} method
762
762
*/
763
- public setFunctionName ( name : string ) : void {
763
+ /* v8 ignore start */ public setFunctionName ( name : string ) : void {
764
764
this . functionName = name ;
765
- }
765
+ } /* v8 ignore end */
766
766
767
767
/**
768
768
* Set the flag to throw an error if no metrics are emitted.
Original file line number Diff line number Diff line change @@ -65,27 +65,6 @@ describe('ColdStart metric', () => {
65
65
) ;
66
66
} ) ;
67
67
68
- it ( 'includes the function name in the cold start metric' , ( ) => {
69
- // Prepare
70
- const functionName = 'my-function' ;
71
- const metrics = new Metrics ( {
72
- namespace : DEFAULT_NAMESPACE ,
73
- } ) ;
74
- metrics . setFunctionName ( functionName ) ;
75
-
76
- // Act
77
- metrics . captureColdStartMetric ( ) ;
78
-
79
- // Assess
80
- expect ( console . log ) . toHaveEmittedEMFWith (
81
- expect . objectContaining ( {
82
- service : 'hello-world' ,
83
- [ COLD_START_METRIC ] : 1 ,
84
- function_name : 'my-function' ,
85
- } )
86
- ) ;
87
- } ) ;
88
-
89
68
it ( 'does not override the function name from constructor in the cold start metric' , ( ) => {
90
69
// Prepare
91
70
const functionName = 'my-function' ;
You can’t perform that action at this time.
0 commit comments