0
Fork 0
mirror of https://github.com/TanStack/router.git synced 2026-11-16 19:38:07 +00:00
router/.changeset
Manuel Schiller 6ddaed9f70 feat(start): experimental Vitest support and typed test helpers
- With `tanstackStart()` in a config that Vitest loads, test files are
  compiled as the app's code is: for the client in browser mode, jsdom
  and happy-dom, for the server in Node. A test run sets up no dev
  server, preview server or build. A project needs no router entry and
  no routes. The route tree is generated once, and route files are never
  written.
- `mockServerFn` and `resetServerFnMocks` in `<framework>-start/testing`:
  in a client test a server function call goes to a mock that is typed
  from the function, in place of a request.
- `runInRequest`, `mockMiddleware` and `runMiddleware` in
  `<framework>-start/testing/server`: a server test runs server functions
  and middleware for a request it describes.
- Mocks end with the test that registered them. The plugin adds a setup
  file to every Vitest project for that.
- In a test run the server finds a server function by its id alone.
  Vitest serves compiled modules from its cache from the second run on,
  so the compiler has no record of them.
- In a test run Start names its packages in `resolve.noExternal` with
  regular expressions. Vitest's translation of the wildcards does not
  match a `-`, so jsdom and Node tests of an installed project ran
  `@tanstack/start-client-core` uncompiled.
- `@tanstack/react-start` pre-bundles `@tanstack/react-store` by a path
  that also resolves from a project that depends on Start only.
- `scripts/e2e/run-as-installed.mjs` runs an e2e project from a
  `pnpm deploy` copy, where `@tanstack/*` are in `node_modules` as in a
  user's project.
- `e2e/react-start/vitest-library` and `e2e/react-start/vitest-app` run
  their tests with an empty Vitest cache, from the warm cache and as an
  installed project.
- Docs: `docs/start/framework/react/guide/testing.md`.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
History 2026-11-15 17:10:33 +01:00
..
config.json chore: migrate changesets changelog generator (#7490) 2026-05-26 19:30:23 +02:00
react-start-prebundle-store-path.md feat(start): experimental Vitest support and typed test helpers 2026-11-15 17:10:33 +01:00
rsbuild-manifest-module-chunks-once.md perf(start-plugin-core): count imported modules once in the Rsbuild manifest pass (#8926) 2026-11-13 14:28:55 +01:00
rsbuild-manifest-own-chunks.md fix(start-plugin-core): Rsbuild manifests list only a route's own chunks (#8876) 2026-11-08 11:42:43 +01:00
rsbuild-rule-use-falsy-loaders.md chore(deps): bump @rsbuild/core to 2.3.1 (#8890) 2026-11-08 10:47:24 +01:00
rsbuild-virtual-modules-build.md fix(start-plugin-core): restore the build of the Rsbuild virtual modules (#8907) 2026-11-08 18:34:35 +01:00
rsbuild-virtual-modules-root.md fix(start-plugin-core): write Rsbuild virtual modules under the app's root, not the working directory (#8868) 2026-11-08 11:42:24 +01:00
rsc-security-floor.md fix(react-start-rsc): bump RSC bundler deps for RSC (#8919) 2026-11-12 09:33:28 +01:00
start-mock-server-fn.md feat(start): experimental Vitest support and typed test helpers 2026-11-15 17:10:33 +01:00
start-server-fn-custom-id-check.md fix(start-plugin-core): refuse custom server-fn ids that never worked over HTTP, deprecate the rest outside the unreserved set (#8858) 2026-11-08 11:42:06 +01:00
start-server-test-harness.md feat(start): experimental Vitest support and typed test helpers 2026-11-15 17:10:33 +01:00
start-vite-root-library-discovery.md fix(start-plugin-core): find Start libraries from Vite's root, not the working directory (#8866) 2026-11-08 11:41:37 +01:00
start-vitest-test-runs.md feat(start): experimental Vitest support and typed test helpers 2026-11-15 17:10:33 +01:00