Skip to content

Commit 3220b92

Browse files
committed
Use new Transports API in stacktrace integration tests.
1 parent 1ccd749 commit 3220b92

File tree

3 files changed

+12
-9
lines changed
  • packages/integration-tests/suites/stacktraces

3 files changed

+12
-9
lines changed

packages/integration-tests/suites/stacktraces/protocol_containing_fn_identifiers/test.ts

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

34
import { sentryTest } from '../../../utils/fixtures';
4-
import { getSentryRequest } from '../../../utils/helpers';
5+
import { getFirstSentryEnvelopeRequest } from '../../../utils/helpers';
56

67
sentryTest(
78
'should parse function identifiers that contain protocol names correctly',
89
async ({ getLocalTestPath, page, runInChromium, runInFirefox, runInWebkit }) => {
910
const url = await getLocalTestPath({ testDir: __dirname });
1011

11-
const eventData = await getSentryRequest(page, url);
12+
const eventData = await getFirstSentryEnvelopeRequest<Event>(page, url);
1213
const frames = eventData.exception?.values?.[0].stacktrace?.frames;
1314

1415
runInChromium(() => {
@@ -52,7 +53,7 @@ sentryTest(
5253
sentryTest('should not add any part of the function identifier inside filename', async ({ getLocalTestPath, page }) => {
5354
const url = await getLocalTestPath({ testDir: __dirname });
5455

55-
const eventData = await getSentryRequest(page, url);
56+
const eventData = await getFirstSentryEnvelopeRequest<Event>(page, url);
5657

5758
expect(eventData.exception?.values?.[0].stacktrace?.frames).toMatchObject(
5859
Array(7).fill({ filename: expect.stringMatching(/^file:\/?/) }),

packages/integration-tests/suites/stacktraces/protocol_fn_identifiers/test.ts

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

34
import { sentryTest } from '../../../utils/fixtures';
4-
import { getSentryRequest } from '../../../utils/helpers';
5+
import { getFirstSentryEnvelopeRequest } from '../../../utils/helpers';
56

67
sentryTest(
78
'should parse function identifiers that are protocol names correctly',
89
async ({ getLocalTestPath, page, runInChromium, runInFirefox, runInWebkit }) => {
910
const url = await getLocalTestPath({ testDir: __dirname });
1011

11-
const eventData = await getSentryRequest(page, url);
12+
const eventData = await getFirstSentryEnvelopeRequest<Event>(page, url);
1213
const frames = eventData.exception?.values?.[0].stacktrace?.frames;
1314

1415
runInChromium(() => {
@@ -52,7 +53,7 @@ sentryTest(
5253
sentryTest('should not add any part of the function identifier inside filename', async ({ getLocalTestPath, page }) => {
5354
const url = await getLocalTestPath({ testDir: __dirname });
5455

55-
const eventData = await getSentryRequest(page, url);
56+
const eventData = await getFirstSentryEnvelopeRequest<Event>(page, url);
5657

5758
expect(eventData.exception?.values?.[0].stacktrace?.frames).toMatchObject(
5859
Array(7).fill({ filename: expect.stringMatching(/^file:\/?/) }),

packages/integration-tests/suites/stacktraces/regular_fn_identifiers/test.ts

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

34
import { sentryTest } from '../../../utils/fixtures';
4-
import { getSentryRequest } from '../../../utils/helpers';
5+
import { getFirstSentryEnvelopeRequest } from '../../../utils/helpers';
56

67
sentryTest(
78
'should parse function identifiers correctly',
89
async ({ getLocalTestPath, page, runInChromium, runInFirefox, runInWebkit }) => {
910
const url = await getLocalTestPath({ testDir: __dirname });
1011

11-
const eventData = await getSentryRequest(page, url);
12+
const eventData = await getFirstSentryEnvelopeRequest<Event>(page, url);
1213
const frames = eventData.exception?.values?.[0].stacktrace?.frames;
1314

1415
runInChromium(() => {
@@ -55,7 +56,7 @@ sentryTest(
5556
sentryTest('should not add any part of the function identifier inside filename', async ({ getLocalTestPath, page }) => {
5657
const url = await getLocalTestPath({ testDir: __dirname });
5758

58-
const eventData = await getSentryRequest(page, url);
59+
const eventData = await getFirstSentryEnvelopeRequest<Event>(page, url);
5960

6061
expect(eventData.exception?.values?.[0].stacktrace?.frames).toMatchObject(
6162
Array(8).fill({ filename: expect.stringMatching(/^file:\/?/) }),

0 commit comments

Comments
 (0)