test(react-grab): cover enrichServerFrameLocations owner-stack merge - #506
Closed
aidenybai wants to merge 1 commit into
Closed
test(react-grab): cover enrichServerFrameLocations owner-stack merge#506aidenybai wants to merge 1 commit into
aidenybai wants to merge 1 commit into
Conversation
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.
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
commit: |
4 tasks
Owner
Author
|
Superseded by #510, which consolidates all the test-coverage PRs into one. Commits preserved there. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
enrichServerFrameLocationsand 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 flaggednext-server-frames.tsat 41% lines / 5% branches, and the e2e suite skips Next.traverseFiber/hasDebugStack/formatOwnerStack/parseStackso the merge logic runs deterministically in node (no real fiber tree), covering:symbolicateServerFrames<unknown>methodName+nullline/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 affectsymbolicateServerFrames(which uses no bippy runtime exports).Test plan
vp test run tests— 63 unit tests pass (13 in this file)pnpm typecheckcleanpnpm lintcleanNote
Low Risk
Test-only changes with no production code modifications.
Overview
Adds unit tests in
next-server-frames.test.tsforenrichServerFrameLocations(Next server-component location recovery from React owner debug stacks) and one extrasymbolicateServerFramescase.enrichServerFrameLocations: Mocksbippy/bippy/sourceso 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>formethodNameandnullfor 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
enrichServerFrameLocationsowner-stack merge andsymbolicateServerFramesfallbacks to validate Next.js server-component frame recovery. Stubbippytraversal 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.