Skip to content

Commit

Permalink
Use new Transports API in stacktrace integration tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
onurtemizkan committed Apr 29, 2022
1 parent 1ccd749 commit 3220b92
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import { expect } from '@playwright/test';
import { Event } from '@sentry/types';

import { sentryTest } from '../../../utils/fixtures';
import { getSentryRequest } from '../../../utils/helpers';
import { getFirstSentryEnvelopeRequest } from '../../../utils/helpers';

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

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

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

const eventData = await getSentryRequest(page, url);
const eventData = await getFirstSentryEnvelopeRequest<Event>(page, url);

expect(eventData.exception?.values?.[0].stacktrace?.frames).toMatchObject(
Array(7).fill({ filename: expect.stringMatching(/^file:\/?/) }),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import { expect } from '@playwright/test';
import { Event } from '@sentry/types';

import { sentryTest } from '../../../utils/fixtures';
import { getSentryRequest } from '../../../utils/helpers';
import { getFirstSentryEnvelopeRequest } from '../../../utils/helpers';

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

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

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

const eventData = await getSentryRequest(page, url);
const eventData = await getFirstSentryEnvelopeRequest<Event>(page, url);

expect(eventData.exception?.values?.[0].stacktrace?.frames).toMatchObject(
Array(7).fill({ filename: expect.stringMatching(/^file:\/?/) }),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import { expect } from '@playwright/test';
import { Event } from '@sentry/types';

import { sentryTest } from '../../../utils/fixtures';
import { getSentryRequest } from '../../../utils/helpers';
import { getFirstSentryEnvelopeRequest } from '../../../utils/helpers';

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

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

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

const eventData = await getSentryRequest(page, url);
const eventData = await getFirstSentryEnvelopeRequest<Event>(page, url);

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

0 comments on commit 3220b92

Please sign in to comment.