Skip to content

test(react-grab): cover enrichServerFrameLocations owner-stack merge - #506

Closed
aidenybai wants to merge 1 commit into
mainfrom
test/next-server-frames-enrich
Closed

test(react-grab): cover enrichServerFrameLocations owner-stack merge#506
aidenybai wants to merge 1 commit into
mainfrom
test/next-server-frames-enrich

Conversation

@aidenybai

@aidenybai aidenybai commented Jun 29, 2026

Copy link
Copy Markdown
Owner

Summary

  • enrichServerFrameLocations and its owner-stack extraction (the fiber debug-stack recovery path used to recover Next.js server-component file locations) had zero unit coverage — the report flagged next-server-frames.ts at 41% lines / 5% branches, and the e2e suite skips Next.
  • Stubs bippy's traverseFiber/hasDebugStack/formatOwnerStack/parseStack so the merge logic runs deterministically in node (no real fiber tree), covering:
    • the two early exits (no unresolved server frames; debug stack yields no server frames),
    • the name-matched file/line/column merge — including first-match-wins dedup and server-URL-only / named-frame filtering,
    • the no-match passthrough.
  • Also adds the cheap symbolicateServerFrames <unknown> methodName + null line/column fallbacks for a bare server frame missing that metadata.

These extend the existing next-server-frames.test.ts; the bippy mock is scoped to this file and does not affect symbolicateServerFrames (which uses no bippy runtime exports).

Test plan

  • vp test run tests — 63 unit tests pass (13 in this file)
  • pnpm typecheck clean
  • pnpm lint clean

Note

Low Risk
Test-only changes with no production code modifications.

Overview
Adds unit tests in next-server-frames.test.ts for enrichServerFrameLocations (Next server-component location recovery from React owner debug stacks) and one extra symbolicateServerFrames case.

enrichServerFrameLocations: Mocks bippy / bippy/source so fiber traversal and stack parsing are deterministic in Node. Covers early returns when there are no unresolved server frames or no server URLs in the debug stack; merging file/line/column by function name with first-match-wins; filtering non-server URLs and unnamed frames; and passthrough when names do not match.

symbolicateServerFrames: Asserts the POST body uses <unknown> for methodName and null for line/column when a server frame omits that metadata.

Reviewed by Cursor Bugbot for commit 5dee96c. Bugbot is set up for automated code reviews on this repo. Configure here.


Summary by cubic

Add unit tests for enrichServerFrameLocations owner-stack merge and symbolicateServerFrames fallbacks to validate Next.js server-component frame recovery. Stub bippy traversal so tests run deterministically and cover early exits, first-match-wins name merge with server-URL filtering, no-match passthrough, and <unknown>/null fallbacks for bare server frames.

Written for commit 5dee96c. Summary will update on new commits.

Review in cubic

The fiber debug-stack recovery path (enrichServerFrameLocations and its
owner-stack extraction) had no unit coverage. Stub bippy's fiber traversal
to exercise the no-unresolved/no-server-frame early exits, the name-matched
file/line/column merge (first-match-wins, server-URL-only filtering), and
the no-match passthrough. Also cover symbolicateServerFrames' <unknown>
methodName and null line/column fallbacks for bare server frames.
@vercel

vercel Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
react-grab-storybook Ready Ready Preview, Comment Jun 29, 2026 3:20am
react-grab-website Ready Ready Preview, Comment Jun 29, 2026 3:20am

@pkg-pr-new

pkg-pr-new Bot commented Jun 29, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@react-grab/cli@506
npm i https://pkg.pr.new/grab@506
npm i https://pkg.pr.new/react-grab@506

commit: 5dee96c

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 1 file

Re-trigger cubic

@aidenybai

Copy link
Copy Markdown
Owner Author

Superseded by #510, which consolidates all the test-coverage PRs into one. Commits preserved there.

@aidenybai aidenybai closed this Jun 29, 2026
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.

1 participant