Skip to content

Commit 21dd0c8

Browse files
committed
chore: ignore deprecated method from coverage
1 parent f5e5ac0 commit 21dd0c8

File tree

2 files changed

+2
-23
lines changed

2 files changed

+2
-23
lines changed

packages/metrics/src/Metrics.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -760,9 +760,9 @@ class Metrics extends Utility implements MetricsInterface {
760760
* - `POWERTOOLS_FUNCTION_NAME` environment variable
761761
* - {@link Metrics.captureColdStartMetric | `captureColdStartMetric('myFunctionName')`} method
762762
*/
763-
public setFunctionName(name: string): void {
763+
/* v8 ignore start */ public setFunctionName(name: string): void {
764764
this.functionName = name;
765-
}
765+
} /* v8 ignore end */
766766

767767
/**
768768
* Set the flag to throw an error if no metrics are emitted.

packages/metrics/tests/unit/coldStartMetric.test.ts

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -65,27 +65,6 @@ describe('ColdStart metric', () => {
6565
);
6666
});
6767

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-
8968
it('does not override the function name from constructor in the cold start metric', () => {
9069
// Prepare
9170
const functionName = 'my-function';

0 commit comments

Comments
 (0)