Skip to content

Commit 1f8f34c

Browse files
committed
more Event -> SerializedEvent
1 parent 16bce17 commit 1f8f34c

File tree

2 files changed

+6
-15
lines changed
  • dev-packages/browser-integration-tests/suites/public-api

2 files changed

+6
-15
lines changed

dev-packages/browser-integration-tests/suites/public-api/startSpan/basic/test.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { expect } from '@playwright/test';
2-
import type { Event } from '@sentry/types';
2+
import type { SerializedEvent } from '@sentry/types';
33

44
import { sentryTest } from '../../../../utils/fixtures';
55
import { getFirstSentryEnvelopeRequest, shouldSkipTracingTest } from '../../../../utils/helpers';
@@ -10,7 +10,7 @@ sentryTest('should send a transaction in an envelope', async ({ getLocalTestPath
1010
}
1111

1212
const url = await getLocalTestPath({ testDir: __dirname });
13-
const transaction = await getFirstSentryEnvelopeRequest<Event>(page, url);
13+
const transaction = await getFirstSentryEnvelopeRequest<SerializedEvent>(page, url);
1414

1515
expect(transaction.transaction).toBe('parent_span');
1616
expect(transaction.spans).toBeDefined();
@@ -22,15 +22,13 @@ sentryTest('should report finished spans as children of the root transaction', a
2222
}
2323

2424
const url = await getLocalTestPath({ testDir: __dirname });
25-
const transaction = await getFirstSentryEnvelopeRequest<Event>(page, url);
25+
const transaction = await getFirstSentryEnvelopeRequest<SerializedEvent>(page, url);
2626

2727
const rootSpanId = transaction?.contexts?.trace?.span_id;
2828

2929
expect(transaction.spans).toHaveLength(1);
3030

3131
const span_1 = transaction.spans?.[0];
32-
// eslint-disable-next-line deprecation/deprecation
3332
expect(span_1?.description).toBe('child_span');
34-
// @ts-expect-error this property is not defined on Event. But in fact, `parent_span_id` is correct here
3533
expect(span_1?.parent_span_id).toEqual(rootSpanId);
3634
});
Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { expect } from '@playwright/test';
2-
import type { Event } from '@sentry/types';
2+
import type { SerializedEvent } from '@sentry/types';
33

44
import { sentryTest } from '../../../../utils/fixtures';
55
import { getFirstSentryEnvelopeRequest, shouldSkipTracingTest } from '../../../../utils/helpers';
@@ -10,7 +10,7 @@ sentryTest('should report a transaction in an envelope', async ({ getLocalTestPa
1010
}
1111

1212
const url = await getLocalTestPath({ testDir: __dirname });
13-
const transaction = await getFirstSentryEnvelopeRequest<Event>(page, url);
13+
const transaction = await getFirstSentryEnvelopeRequest<SerializedEvent>(page, url);
1414

1515
expect(transaction.transaction).toBe('test_transaction_1');
1616
expect(transaction.spans).toBeDefined();
@@ -22,30 +22,23 @@ sentryTest('should report finished spans as children of the root transaction', a
2222
}
2323

2424
const url = await getLocalTestPath({ testDir: __dirname });
25-
const transaction = await getFirstSentryEnvelopeRequest<Event>(page, url);
25+
const transaction = await getFirstSentryEnvelopeRequest<SerializedEvent>(page, url);
2626

2727
const rootSpanId = transaction?.contexts?.trace?.span_id;
2828

2929
expect(transaction.spans).toHaveLength(3);
3030

3131
const span_1 = transaction.spans?.[0];
3232

33-
// eslint-disable-next-line deprecation/deprecation
3433
expect(span_1?.op).toBe('span_1');
35-
// @ts-expect-error this property is not defined on the incorrectly used Event
3634
expect(span_1?.parent_span_id).toEqual(rootSpanId);
37-
// eslint-disable-next-line deprecation/deprecation
3835
expect(span_1?.data).toMatchObject({ foo: 'bar', baz: [1, 2, 3] });
3936

4037
const span_3 = transaction.spans?.[1];
41-
// eslint-disable-next-line deprecation/deprecation
4238
expect(span_3?.op).toBe('span_3');
43-
// @ts-expect-error this property is not defined on the incorrectly used Event
4439
expect(span_3?.parent_span_id).toEqual(rootSpanId);
4540

4641
const span_5 = transaction.spans?.[2];
47-
// eslint-disable-next-line deprecation/deprecation
4842
expect(span_5?.op).toBe('span_5');
49-
// @ts-expect-error this property is not defined on the incorrectly used Event
5043
expect(span_5?.parent_span_id).toEqual(span_3?.span_id);
5144
});

0 commit comments

Comments
 (0)