Skip to content

test(router-utils): re-enable unit tests - #8849

Merged
Sheraff merged 1 commit into
mainfrom
test/router-utils-enable-unit-tests
Nov 3, 2026
Merged

Sheraff merged 1 commit into
mainfrom
test/router-utils-enable-unit-tests

Conversation

@Sheraff

@Sheraff Sheraff commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

@tanstack/router-utils's test:unit script has been exit 0; vitest --typecheck since the package was created (#3287), so its tests never ran in CI. They already pass on main (2 files, 28 tests, no type errors), so this switches the script to vitest. Type checking stays on through typecheck: { enabled: true } in vite.config.ts.

This is split out of #8817, which makes the same script change.

Validated with nx run-many -p @tanstack/router-utils -t test:unit,test:types,test:eslint.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Tests
    • Updated the unit-test workflow to run the test suite directly. The command no longer performs an additional type-check step, so its execution is focused on unit tests. This change affects the project’s testing workflow only; no user-facing features or product behavior have changed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Nov 3, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 71e07ab

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@nx-cloud

nx-cloud Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

View your CI Pipeline Execution ↗ for commit 71e07ab

Command Status Duration Result
nx affected --targets=test:eslint,test:unit,tes... ✅ Succeeded 11m 59s View ↗
nx run-many --target=build --exclude=examples/*... ✅ Succeeded 1m 22s View ↗

☁️ Nx Cloud last updated this comment at 2026-11-03 14:46:02 UTC

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

🚀 Changeset Version Preview

No changeset entries found. Merging this PR will not cause a version bump for any packages.

@pkg-pr-new

pkg-pr-new Bot commented Nov 3, 2026

Copy link
Copy Markdown
More templates

@tanstack/arktype-adapter

npm i https://pkg.pr.new/@tanstack/arktype-adapter@8849

@tanstack/eslint-plugin-router

npm i https://pkg.pr.new/@tanstack/eslint-plugin-router@8849

@tanstack/eslint-plugin-start

npm i https://pkg.pr.new/@tanstack/eslint-plugin-start@8849

@tanstack/history

npm i https://pkg.pr.new/@tanstack/history@8849

@tanstack/react-router

npm i https://pkg.pr.new/@tanstack/react-router@8849

@tanstack/react-router-devtools

npm i https://pkg.pr.new/@tanstack/react-router-devtools@8849

@tanstack/react-router-ssr-query

npm i https://pkg.pr.new/@tanstack/react-router-ssr-query@8849

@tanstack/react-start

npm i https://pkg.pr.new/@tanstack/react-start@8849

@tanstack/react-start-client

npm i https://pkg.pr.new/@tanstack/react-start-client@8849

@tanstack/react-start-rsc

npm i https://pkg.pr.new/@tanstack/react-start-rsc@8849

@tanstack/react-start-server

npm i https://pkg.pr.new/@tanstack/react-start-server@8849

@tanstack/router-cli

npm i https://pkg.pr.new/@tanstack/router-cli@8849

@tanstack/router-core

npm i https://pkg.pr.new/@tanstack/router-core@8849

@tanstack/router-devtools

npm i https://pkg.pr.new/@tanstack/router-devtools@8849

@tanstack/router-devtools-core

npm i https://pkg.pr.new/@tanstack/router-devtools-core@8849

@tanstack/router-generator

npm i https://pkg.pr.new/@tanstack/router-generator@8849

@tanstack/router-plugin

npm i https://pkg.pr.new/@tanstack/router-plugin@8849

@tanstack/router-ssr-query-core

npm i https://pkg.pr.new/@tanstack/router-ssr-query-core@8849

@tanstack/router-utils

npm i https://pkg.pr.new/@tanstack/router-utils@8849

@tanstack/router-vite-plugin

npm i https://pkg.pr.new/@tanstack/router-vite-plugin@8849

@tanstack/solid-router

npm i https://pkg.pr.new/@tanstack/solid-router@8849

@tanstack/solid-router-devtools

npm i https://pkg.pr.new/@tanstack/solid-router-devtools@8849

@tanstack/solid-router-ssr-query

npm i https://pkg.pr.new/@tanstack/solid-router-ssr-query@8849

@tanstack/solid-start

npm i https://pkg.pr.new/@tanstack/solid-start@8849

@tanstack/solid-start-client

npm i https://pkg.pr.new/@tanstack/solid-start-client@8849

@tanstack/solid-start-server

npm i https://pkg.pr.new/@tanstack/solid-start-server@8849

@tanstack/start-client-core

npm i https://pkg.pr.new/@tanstack/start-client-core@8849

@tanstack/start-fn-stubs

npm i https://pkg.pr.new/@tanstack/start-fn-stubs@8849

@tanstack/start-plugin-core

npm i https://pkg.pr.new/@tanstack/start-plugin-core@8849

@tanstack/start-server-core

npm i https://pkg.pr.new/@tanstack/start-server-core@8849

@tanstack/start-static-server-functions

npm i https://pkg.pr.new/@tanstack/start-static-server-functions@8849

@tanstack/start-storage-context

npm i https://pkg.pr.new/@tanstack/start-storage-context@8849

@tanstack/valibot-adapter

npm i https://pkg.pr.new/@tanstack/valibot-adapter@8849

@tanstack/virtual-file-routes

npm i https://pkg.pr.new/@tanstack/virtual-file-routes@8849

@tanstack/vue-router

npm i https://pkg.pr.new/@tanstack/vue-router@8849

@tanstack/vue-router-devtools

npm i https://pkg.pr.new/@tanstack/vue-router-devtools@8849

@tanstack/vue-router-ssr-query

npm i https://pkg.pr.new/@tanstack/vue-router-ssr-query@8849

@tanstack/vue-start

npm i https://pkg.pr.new/@tanstack/vue-start@8849

@tanstack/vue-start-client

npm i https://pkg.pr.new/@tanstack/vue-start-client@8849

@tanstack/vue-start-server

npm i https://pkg.pr.new/@tanstack/vue-start-server@8849

@tanstack/zod-adapter

npm i https://pkg.pr.new/@tanstack/zod-adapter@8849

commit: 71e07ab

@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Walkthrough

The test:unit script in packages/router-utils/package.json now runs vitest directly.

Changes: Router utils unit tests

Layer / File(s) Summary
Update unit test command
packages/router-utils/package.json
The test:unit script now invokes vitest directly instead of exiting successfully before invoking Vitest with --typecheck.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Other

Suggested reviewers: schiller-manuel

Merge Risk: Minimal · up to 71e07

This focused change re-enables the router-utils unit test command without introducing an actionable merge risk.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title "test(router-utils): re-enable unit tests" matches the main change. The PR changes the router-utils test:unit script from "exit 0; vitest --typecheck" to "vitest", so the unit tests run agai…
Description check Passed The description covers the change and its motivation. It explains that the test:unit script exited early with "exit 0", so tests never ran in CI. It reports that the tests already pass on main (2 file…
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "test(router-utils): re-enable unit tests" matches the main change. The PR changes the router-utils test:unit script from "exit 0; vitest --typecheck" to "vitest", so the unit tests run again. The title is specific, short, and uses a conventional commit style.

Full details: Description check

Explanation

The description covers the change and its motivation. It explains that the test:unit script exited early with "exit 0", so tests never ran in CI. It reports that the tests already pass on main (2 files, 28 tests, no type errors). It states that type checking stays enabled through typecheck: { enabled: true } in vite.config.ts. It lists the validation command and links the related PR #8817. The description does not follow the repository template. It has no Checklist section and no Release Impact section, and it does not disclose AI authorship in the template's required form, even though it includes a Claude Code attribution line. The description is mostly complete, so the check passes, but the author should add the missing template sections.

Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)

Finishing Touches
Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Tip

🎯 Customize your risk assessments

Guide how CodeRabbit assesses merge risk and security architecture risk. Highlight sensitive changes and explain your security boundaries using Merge Risk Instructions and Security Risk Instructions in your review settings. Security architecture risk assessments require the Advanced plan or above.

✅ Automatic approvals, with your rules

Let CodeRabbit approve pull requests once required threads are resolved, pre-merge checks pass, and your risk limits are met. Enable Automatic approvals in review settings, with overrides for teams or file paths.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.
Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between f723f3b and 71e07ab.

Files selected for processing: 1
  • packages/router-utils/package.json

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Bundle Size Benchmarks

This pull request does not affect bundle size in any measured scenario.

@codspeed

codspeed Bot commented Nov 3, 2026

Copy link
Copy Markdown

Merging this PR will improve performance by 6.81%

2 warnings

⚠️ 49 benchmarks are dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

⚠️ 1 benchmark with a significant change ran on different hardware

Its base and head results were measured on machines with a different CPU, core count or memory, so the change might not come from the code. Run base and head on the same runner type.

Learn more about Macro Runners

See affected benchmarks

⚡ 1 improved benchmark
✅ 193 untouched benchmarks
⏩ 3 skipped benchmarks1

Performance Changes

Mode Benchmark BASE HEAD Efficiency
⚡ Memory mem server error-paths redirect (solid) 12 KB 11.2 KB +6.81%

Tip

Curious why performance improved? Comment @codspeedbot explain why performance improved on this PR, or directly use the CodSpeed MCP with your agent.


Comparing test/router-utils-enable-unit-tests (71e07ab) with main (f723f3b)

Open in CodSpeed

Footnotes

  1. 3 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

@Sheraff
Sheraff merged commit c28c7eb into main Nov 3, 2026
30 checks passed
@Sheraff
Sheraff deleted the test/router-utils-enable-unit-tests branch November 3, 2026 15:08
Sheraff added a commit that referenced this pull request Nov 3, 2026
Main landed parts of this PR separately against the old compiler
(#8851, #8852, #8853, #8855, #8856) and re-enabled the router-utils unit
tests (#8849): the PR already has each of them. The old-compiler files
main edited stay deleted; the entries keep the PR's implementation (same
esbuild error message). Main's changesets stay; the duplicated bullets
leave the PR's router-plugin, route generator and compiler core
changesets. The router plugin skill takes main's esbuild wording.

#8857 (route-group layouts typed with full path '/'): the PR's generator
already types them '/'. Main's test that a childless `_auth.tsx` next to
the index route conflicts is dropped: SPEC J1.15 makes that pair valid
here (route-paths.test.ts checks it through the router).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sheraff added a commit that referenced this pull request Nov 3, 2026
…ests the PR lacks

`test:unit` stays where main has it (#8849). Main's esbuild unit test
that the plugin refuses `autoCodeSplitting` duplicates the PR's J2.18
build test (integration/build-harness.test.ts); the splitter entry's
refusal and the generator-only entries have no other test and stay.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant