Skip to content

Commit 5742243

Browse files
committed
test: fix test usage of deprecated
1 parent 5956e8d commit 5742243

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1112,7 +1112,7 @@ describe('Class: Metrics', () => {
11121112
let publishStoredMetricsSpy: jest.SpyInstance;
11131113
let addMetricSpy: jest.SpyInstance;
11141114
let captureColdStartMetricSpy: jest.SpyInstance;
1115-
let throwOnEmptyMetricsSpy: jest.SpyInstance;
1115+
let setThrowOnEmptyMetricsSpy: jest.SpyInstance;
11161116
let setDefaultDimensionsSpy: jest.SpyInstance;
11171117
const decoratorLambdaExpectedReturnValue = 'Lambda invoked!';
11181118
const decoratorLambdaMetric = 'decorator-lambda-test-metric';
@@ -1122,7 +1122,7 @@ describe('Class: Metrics', () => {
11221122
publishStoredMetricsSpy = jest.spyOn(metrics, 'publishStoredMetrics');
11231123
addMetricSpy = jest.spyOn(metrics, 'addMetric');
11241124
captureColdStartMetricSpy = jest.spyOn(metrics, 'captureColdStartMetric');
1125-
throwOnEmptyMetricsSpy = jest.spyOn(metrics, 'throwOnEmptyMetrics');
1125+
setThrowOnEmptyMetricsSpy = jest.spyOn(metrics, 'setThrowOnEmptyMetrics');
11261126
setDefaultDimensionsSpy = jest.spyOn(metrics, 'setDefaultDimensions');
11271127
});
11281128

@@ -1145,7 +1145,7 @@ describe('Class: Metrics', () => {
11451145
);
11461146
expect(publishStoredMetricsSpy).toBeCalledTimes(1);
11471147
expect(captureColdStartMetricSpy).not.toBeCalled();
1148-
expect(throwOnEmptyMetricsSpy).not.toBeCalled();
1148+
expect(setThrowOnEmptyMetricsSpy).not.toBeCalled();
11491149
expect(setDefaultDimensionsSpy).not.toBeCalled();
11501150
});
11511151

@@ -1170,7 +1170,7 @@ describe('Class: Metrics', () => {
11701170
);
11711171
expect(captureColdStartMetricSpy).toBeCalledTimes(1);
11721172
expect(publishStoredMetricsSpy).toBeCalledTimes(1);
1173-
expect(throwOnEmptyMetricsSpy).not.toBeCalled();
1173+
expect(setThrowOnEmptyMetricsSpy).not.toBeCalled();
11741174
expect(setDefaultDimensionsSpy).not.toBeCalled();
11751175
});
11761176

@@ -1193,7 +1193,7 @@ describe('Class: Metrics', () => {
11931193
MetricUnit.Count,
11941194
1
11951195
);
1196-
expect(throwOnEmptyMetricsSpy).toBeCalledTimes(1);
1196+
expect(setThrowOnEmptyMetricsSpy).toBeCalledTimes(1);
11971197
expect(publishStoredMetricsSpy).toBeCalledTimes(1);
11981198
expect(captureColdStartMetricSpy).not.toBeCalled();
11991199
expect(setDefaultDimensionsSpy).not.toBeCalled();
@@ -1227,7 +1227,7 @@ describe('Class: Metrics', () => {
12271227
defaultDimensions
12281228
);
12291229
expect(publishStoredMetricsSpy).toBeCalledTimes(1);
1230-
expect(throwOnEmptyMetricsSpy).not.toBeCalled();
1230+
expect(setThrowOnEmptyMetricsSpy).not.toBeCalled();
12311231
expect(captureColdStartMetricSpy).not.toBeCalled();
12321232
});
12331233

0 commit comments

Comments
 (0)