test(app-router): isolate * param route-graph case from Windows#2697
Open
MaxtuneLee wants to merge 2 commits into
Open
test(app-router): isolate * param route-graph case from Windows#2697MaxtuneLee wants to merge 2 commits into
MaxtuneLee wants to merge 2 commits into
Conversation
commit: |
Contributor
Performance benchmarksCompared 1 improved · 0 regressed · 5 within ±1.5%
View detailed results and traces 🟢 improvement · 🔴 regression · ⚫ change below 1.5% · paired base/head |
MaxtuneLee
marked this pull request as ready for review
July 24, 2026 16:51
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
Related to #1792
The App Router route-graph test "skips routes whose param names end in + or *" builds a temp fixture directory named
[id*].*is a reserved character in Windows filenames, so that directory can't be created on Windows — the test throws before it can assert, makingvp test rununrunnable locally on Windows even though the source under test is fine.This PR splits the test so the valid-on-every-platform case (
+) keeps running everywhere, and the POSIX-only case (*) is gated withit.runIf(process.platform !== "win32"). No source/runtime code changes — this is a test-portability fix.Root cause
Windows filenames may not contain
< > : " / \ | ? *. The App Router fixture uses*:[id*]/page.tsxmkdirthrowsENOENT/ "The filename, directory name, or volume label syntax is incorrect"Crucially, this is an unreachable scenario on Windows in production too: a real Next.js app on Windows can't have an
[id*]directory on disk, sobuildAppRouteGraphwill never encounter one there. Gating the fixture to POSIX loses zero real Windows coverage while keeping full coverage on CI (Linux).Changes
tests/app-route-graph.test.ts+test (all platforms) and a*test gated to POSIX.Verification
Before (Windows):
After (Windows):
The 1 skip is exactly the POSIX-only
*case. On Linux/macOS it continues to run unchanged (the guard evaluates true).vp check tests/app-route-graph.test.tspasses (format, lint, type).Test plan
vp test run --project unit tests/app-route-graph.test.ts(Windows) — greenvp check tests/app-route-graph.test.ts— format/lint/type clean*case