Skip to content

test(nuxt): Cover pages router instrumentation - #24583

Draft
vansh-nagar wants to merge 1 commit into
getsentry:developfrom
vansh-nagar:fix/nuxt-pages-router-tests
Draft

vansh-nagar wants to merge 1 commit into
getsentry:developfrom
vansh-nagar:fix/nuxt-pages-router-tests

Conversation

@vansh-nagar

Copy link
Copy Markdown

The Nuxt client plugin's pages-router integration had no direct unit coverage after the earlier SDK-level BrowserTracing assertion was removed.

This adds focused checks that the initialized client receives BrowserTracing with Nuxt's router and path-based route labels, while an uninitialized client does not create the integration.

Fixes #13813

@s1gr1d s1gr1d self-assigned this Sep 29, 2026

@s1gr1d s1gr1d left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the PR!

We already cover pages-router instrumentation in the nuxt-4 E2E app. The remaining value of a unit test here is covering the branches that E2E doesn't cover: a test that browserTracingIntegration is not called and addIntegration is only called for the vue integration path (similar to 'does not create router instrumentation without an initialized client'). But we need coverage for if (sentryClient && '$router' in nuxtApp).

@s1gr1d s1gr1d added the external PR from an external contributor label Sep 29, 2026
Fixes getsentry#13813

Co-Authored-By: OpenAI Codex <codex@openai.com>
@vansh-nagar
vansh-nagar force-pushed the fix/nuxt-pages-router-tests branch from 0149c63 to 1a80479 Compare September 29, 2026 18:36
@s1gr1d

s1gr1d commented Oct 2, 2026

Copy link
Copy Markdown
Member

This PR is still in draft, do you plan to still add something to it?

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external PR from an external contributor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Nuxt pages router unit tests

2 participants