Skip to content

Commit

Permalink
Update packages/integration-tests/suites/stacktraces/protocol_contain…
Browse files Browse the repository at this point in the history
…ing_fn_identifiers/test.ts

Co-authored-by: Katie Byers <lobsterkatie@gmail.com>
  • Loading branch information
onurtemizkan and lobsterkatie committed Aug 2, 2022
1 parent e44bce8 commit 61ea3f6
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,16 @@ sentryTest(
},
);

sentryTest('should not add any part of the function identifier inside filename', async ({ getLocalTestPath, page }) => {
const url = await getLocalTestPath({ testDir: __dirname });
sentryTest(
'should not add any part of the function identifier to beginning of filename',
async ({ getLocalTestPath, page }) => {
const url = await getLocalTestPath({ testDir: __dirname });

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

expect(eventData.exception?.values?.[0].stacktrace?.frames).toMatchObject(
Array(7).fill({ filename: expect.stringMatching(/^file:\/?/) }),
);
});
expect(eventData.exception?.values?.[0].stacktrace?.frames).toMatchObject(
// specifically, we're trying to avoid values like `Blob@file://path/to/file` in frames with function names like `makeBlob`
Array(7).fill({ filename: expect.stringMatching(/^file:\/?/) }),
);
},
);
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,15 @@ sentryTest(
},
);

sentryTest('should not add any part of the function identifier inside filename', async ({ getLocalTestPath, page }) => {
const url = await getLocalTestPath({ testDir: __dirname });
sentryTest(
'should not add any part of the function identifier to beginning of filename',
async ({ getLocalTestPath, page }) => {
const url = await getLocalTestPath({ testDir: __dirname });

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

expect(eventData.exception?.values?.[0].stacktrace?.frames).toMatchObject(
Array(7).fill({ filename: expect.stringMatching(/^file:\/?/) }),
);
});
expect(eventData.exception?.values?.[0].stacktrace?.frames).toMatchObject(
Array(7).fill({ filename: expect.stringMatching(/^file:\/?/) }),
);
},
);
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,16 @@ sentryTest(
},
);

sentryTest('should not add any part of the function identifier inside filename', async ({ getLocalTestPath, page }) => {
const url = await getLocalTestPath({ testDir: __dirname });
sentryTest(
'should not add any part of the function identifier to beginning of filename',
async ({ getLocalTestPath, page }) => {
const url = await getLocalTestPath({ testDir: __dirname });

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

expect(eventData.exception?.values?.[0].stacktrace?.frames).toMatchObject(
Array(8).fill({ filename: expect.stringMatching(/^file:\/?/) }),
);
});
expect(eventData.exception?.values?.[0].stacktrace?.frames).toMatchObject(
// specifically, we're trying to avoid values like `Blob@file://path/to/file` in frames with function names like `makeBlob`
Array(8).fill({ filename: expect.stringMatching(/^file:\/?/) }),
);
},
);

0 comments on commit 61ea3f6

Please sign in to comment.