Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(browser): Add integration test for httpContextIntegration #13553

Merged
merged 1 commit into from
Sep 3, 2024

Conversation

Lms24
Copy link
Member

@Lms24 Lms24 commented Sep 2, 2024

While investigating #13536 I wrote a quick integration test to check that the httpContextIntegration works as expected. This PR adds said test to our browser integration tests. We have other tests in which we implicitly check that url and user-agent are set but none for referer, so I think this test has value.

@Lms24 Lms24 self-assigned this Sep 2, 2024
@Lms24 Lms24 requested a review from s1gr1d September 2, 2024 12:52
Comment on lines +5 to +7
const integrations = Sentry.getDefaultIntegrations({}).filter(
defaultIntegration => defaultIntegration.name === 'HttpContext',
);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: I isolated this similarly to how the SDK was initialized in the original issue so that only this integration is active.
We don't have to do this but given that all other tests that implicitly check on some of the fields are conventional Sentry.init SDK scenarios, I think we can leave it as-is.

Copy link
Member

@s1gr1d s1gr1d left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks for adding this test

@Lms24 Lms24 merged commit 128ab44 into develop Sep 3, 2024
118 checks passed
@Lms24 Lms24 deleted the lms/test-browser-httpContextIntegration branch September 3, 2024 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants