Skip to content

test(react-router): Add and fix tests for pre rendered routes #16346

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

Merged
merged 4 commits into from
May 21, 2025

Conversation

RulaKhaled
Copy link
Member

It was confirmed that static pre-renders don't pick up Sentry trace meta tags — this just adds a quick test.
More context: https://linear.app/getsentry/issue/JS-392/rr7-evaluate-static-pre-rendering

P.S. Not a priority, but for some reason, I had to add a trailing / to fetch the correct transactions and pass the tests. I’ll look into why this is happening for transaction route names and whether this behavior is expected in a later PR.

@RulaKhaled RulaKhaled marked this pull request as draft May 20, 2025 14:50
@RulaKhaled RulaKhaled changed the title test(react-router): Add and fix tests for pre rendered routes WIP test(react-router): Add and fix tests for pre rendered routes May 20, 2025
@RulaKhaled RulaKhaled changed the title WIP test(react-router): Add and fix tests for pre rendered routes test(react-router): Add and fix tests for pre rendered routes May 20, 2025
@RulaKhaled RulaKhaled marked this pull request as ready for review May 20, 2025 15:44
@RulaKhaled RulaKhaled requested a review from chargome May 20, 2025 15:44
Copy link
Member

@chargome chargome left a comment

Choose a reason for hiding this comment

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

Thanks for adding that!

test('should send pageload transaction for prerendered pages', async ({ page }) => {
const txPromise = waitForTransaction(APP_NAME, async transactionEvent => {
return transactionEvent.transaction === '/performance/static';
return transactionEvent.transaction === '/performance/static/';
Copy link
Member

Choose a reason for hiding this comment

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

strange 🤔

…ork/react-router.config.ts

Co-authored-by: Charly Gomez <charly.gomez@sentry.io>
Copy link

codecov bot commented May 21, 2025

❌ Unsupported file format

Upload processing failed due to unsupported file format. Please review the parser error message:

Error parsing JUnit XML in /home/runner/work/sentry-javascript/sentry-javascript/packages/solidstart/vitest.junit.xml at 107:17

Caused by:
    RuntimeError: Error parsing XML
    
    Caused by:
        0: ill-formed document: expected `</testsuites>`, but `</testsuite>` was found
        1: expected `</testsuites>`, but `</testsuite>` was found

For more help, visit our troubleshooting guide.

@RulaKhaled RulaKhaled merged commit 593d5b3 into develop May 21, 2025
158 checks passed
@RulaKhaled RulaKhaled deleted the test-pre-render-routes branch May 21, 2025 08:05
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