Skip to content

Commit 62c9c62

Browse files
committed
fix tests
1 parent 6fc9e18 commit 62c9c62

File tree

6 files changed

+11
-11
lines changed

6 files changed

+11
-11
lines changed

dev-packages/node-core-integration-tests/suites/public-api/metrics/test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ describe('metrics', () => {
88

99
test('should capture all metric types', async () => {
1010
const runner = createRunner(__dirname, 'scenario.ts')
11-
.unignore('metric')
11+
.unignore('trace_metric')
1212
.expect({
13-
metric: {
13+
trace_metric: {
1414
items: [
1515
{
1616
timestamp: expect.any(Number),

dev-packages/node-core-integration-tests/utils/runner.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ type Expected =
149149
log: ExpectedLogContainer;
150150
}
151151
| {
152-
metric: ExpectedMetricContainer;
152+
trace_metric: ExpectedMetricContainer;
153153
};
154154

155155
type ExpectedEnvelopeHeader =
@@ -409,8 +409,8 @@ export function createRunner(...paths: string[]) {
409409
} else if ('log' in expected) {
410410
expectLog(item[1] as SerializedLogContainer, expected.log);
411411
expectCallbackCalled();
412-
} else if ('metric' in expected) {
413-
expectMetric(item[1] as SerializedMetricContainer, expected.metric);
412+
} else if ('trace_metric' in expected) {
413+
expectMetric(item[1] as SerializedMetricContainer, expected.trace_metric);
414414
expectCallbackCalled();
415415
} else {
416416
throw new Error(

dev-packages/node-integration-tests/suites/public-api/metrics/test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ describe('metrics', () => {
99
test('should capture all metric types', async () => {
1010
const runner = createRunner(__dirname, 'scenario.ts')
1111
.expect({
12-
metric: {
12+
trace_metric: {
1313
items: [
1414
{
1515
timestamp: expect.any(Number),

dev-packages/node-integration-tests/utils/runner.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ type Expected =
157157
log: ExpectedLogContainer;
158158
}
159159
| {
160-
metric: ExpectedMetricContainer;
160+
trace_metric: ExpectedMetricContainer;
161161
};
162162

163163
type ExpectedEnvelopeHeader =
@@ -525,8 +525,8 @@ export function createRunner(...paths: string[]) {
525525
} else if ('log' in expected) {
526526
expectLog(item[1] as SerializedLogContainer, expected.log);
527527
expectCallbackCalled();
528-
} else if ('metric' in expected) {
529-
expectMetric(item[1] as SerializedMetricContainer, expected.metric);
528+
} else if ('trace_metric' in expected) {
529+
expectMetric(item[1] as SerializedMetricContainer, expected.trace_metric);
530530
expectCallbackCalled();
531531
} else {
532532
throw new Error(

packages/core/test/lib/metrics/envelope.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ describe('createMetricEnvelope', () => {
164164
expect.anything(),
165165
expect.arrayContaining([
166166
expect.arrayContaining([
167-
{ type: 'metric', item_count: 2, content_type: 'application/vnd.sentry.items.trace-metric+json' },
167+
{ type: 'trace_metric', item_count: 2, content_type: 'application/vnd.sentry.items.trace-metric+json' },
168168
{ items: mockMetrics },
169169
]),
170170
]),

packages/core/test/lib/metrics/internal.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ describe('_INTERNAL_captureMetric', () => {
110110

111111
_INTERNAL_captureMetric({ type: 'counter', name: 'test.metric', value: 1 }, { scope });
112112

113-
expect(logWarnSpy).toHaveBeenCalledWith('trace metrics option not enabled, metric will not be captured.');
113+
expect(logWarnSpy).toHaveBeenCalledWith('metrics option not enabled, metric will not be captured.');
114114
expect(_INTERNAL_getMetricBuffer(client)).toBeUndefined();
115115

116116
logWarnSpy.mockRestore();

0 commit comments

Comments
 (0)