Skip to content

test(app-router): isolate * param route-graph case from Windows#2697

Open
MaxtuneLee wants to merge 2 commits into
cloudflare:mainfrom
MaxtuneLee:test/windows-app-route-graph-reserved-chars
Open

test(app-router): isolate * param route-graph case from Windows#2697
MaxtuneLee wants to merge 2 commits into
cloudflare:mainfrom
MaxtuneLee:test/windows-app-route-graph-reserved-chars

Conversation

@MaxtuneLee

@MaxtuneLee MaxtuneLee commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

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, making vp test run unrunnable 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 with it.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 *:

Fixture path Result on Windows Effect
[id*]/page.tsx mkdir throws ENOENT / "The filename, directory name, or volume label syntax is incorrect" test errors before asserting

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, so buildAppRouteGraph will 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

  • Split "skips routes whose param names end in + or *" into a + test (all platforms) and a * test gated to POSIX.

Verification

Before (Windows):

FAIL tests/app-route-graph.test.ts > skips routes whose param names end in + or *
  Error: ENOENT: no such file or directory, mkdir '...\app\[id*]'

After (Windows):

vp test run --project unit tests/app-route-graph.test.ts
Test Files  1 passed (1)
     Tests  63 passed | 1 skipped (64)

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.ts passes (format, lint, type).

Test plan

  • vp test run --project unit tests/app-route-graph.test.ts (Windows) — green
  • vp check tests/app-route-graph.test.ts — format/lint/type clean
  • CI (Linux) runs the full suite, exercising the POSIX-only * case

@MaxtuneLee MaxtuneLee changed the title test(app-router): gate Windows-reserved * route fixture to POSIX test(app-router): isolate * param route-graph case from Windows Jul 24, 2026
@pkg-pr-new

pkg-pr-new Bot commented Jul 24, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@vinext/cloudflare@2697
npm i https://pkg.pr.new/create-vinext-app@2697
npm i https://pkg.pr.new/@vinext/types@2697
npm i https://pkg.pr.new/vinext@2697

commit: 454095d

@github-actions

Copy link
Copy Markdown
Contributor

Performance benchmarks

Compared 454095d against base 05eee9f using alternating same-runner rounds. Next.js was unchanged and skipped.

1 improved · 0 regressed · 5 within ±1.5%

Scenario Framework Baseline Current Change
Client bundle size (gzip) vinext 132.4 KB 132.4 KB ⚫ -0.0%
Client entry size (gzip) vinext 119.7 KB 119.7 KB ⚫ -0.0%
Dev server cold start vinext 2.96 s 2.89 s 🟢 -2.3%
Production build time vinext 3.16 s 3.14 s ⚫ -0.4%
RSC entry closure size (gzip) vinext 103.3 KB 103.3 KB ⚫ -0.0%
Server bundle size (gzip) vinext 177.8 KB 177.8 KB ⚫ -0.0%

View detailed results and traces

🟢 improvement · 🔴 regression · ⚫ change below 1.5% · paired base/head

@MaxtuneLee
MaxtuneLee marked this pull request as ready for review July 24, 2026 16:51
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