Skip to content

chore(deps-dev): bump vitest from 4.1.11 to 5.0.1 - #288

Merged
allisonmahmood merged 3 commits into
mainfrom
deps/vitest-5
Sep 19, 2026
Merged

allisonmahmood merged 3 commits into
mainfrom
deps/vitest-5

Conversation

@allisonmahmood

Copy link
Copy Markdown
Owner

@effect/vitest rc.115 declares a peer on vitest 5, which the Effect bump (#284) left as a warning. This moves every package's vitest devDependency to 5.0.1, which clears the peer warning and lands the runner major on its own.

Checked against the Vitest 5 migration guide: the repo uses none of the changed surfaces. No pool or worker id math, no sequential API, no removed entry points, no reporter or coverage config, no nested vi.mock, no toThrow("") or expect.poll; inject, provide and globalSetup are unchanged. Mocks now clear before each test by default, which the one fake-timer suite tolerates.

Verification

  • pnpm lint, pnpm typecheck pass.
  • pnpm test: 939 of 939 pass, no deprecation output.
  • pnpm test:postgres-concurrency: 7 of 7 pass.

Stacked on deps/vite-8 (#286), since vitest 5 requires Vite 6.4 or later.

Model: Claude Fable 5.1. Harness: Claude Code.

@github-actions github-actions Bot added area:server Touches the server area area:ci CI, shared testing infrastructure, development scripts and tooling area:cli Touches the cli area size:s Under 100 changed lines labels Sep 16, 2026

@allisonmahmood allisonmahmood left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed origin/deps/vite-8...f19091c against the Vitest 5 migration guide and PR body.

Standards

No findings. All 17 Vitest declarations and lockfile resolutions agree; Vite 8.3.0, CI's Node 22.22/24, and the Effect Vitest peer are compatible.

Spec

Blocking: packages/portal/package.json:21 runs bare vitest run, but portal has no local config. The guide says "Vitest no longer searches parent directories for config files."

Read-only config probes confirmed v4 loads the root config there; v5 resolves no global setup, offline guard, or development condition. Running the portal suite with isolated temporary caches reproduced three suite failures and 49 skipped tests: inject("postgres").templateDatabase throws at packages/sql/src/testing.ts:47. scripts/test-all.sh:20 reaches this path through Turbo. The reported 939/939 root pass does not cover package-local discovery.

Add packages/portal/vitest.config.ts with the existing Postgres-backed package re-export: export { default } from "../../test/vitest.config.js";.

Other checks:

  • Shared/root/Postgres/Clerk configs and other package configs need no project-inheritance changes. inject/provide remain compatible; database names/ports use no worker-ID arithmetic. clearMocks: true is safe for the test-local mocks.
  • Clerk/all-test scripts and workflows have no Vitest name-boundary filters or reporter-output consumers. Browser tests use Playwright, not Vitest browser mode.
  • .vitest/ is not ignored. JSON/JUnit now default to .vitest/json/output.json and .vitest/junit/output.xml, but neither reporter nor attachment generation is configured. Adding the ignore is optional hygiene, not a blocker.

Not happy to merge on green CI alone: fix and verify the portal package run first, then merge once CI is green.

Standards: 0 findings. Spec: 1 blocking config-discovery regression.

@allisonmahmood allisonmahmood left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Second pass at be3f55b, reviewing origin/deps/vite-8...HEAD.

Standards

No new findings. Portal now uses the existing shared-config re-export.

Spec

Fixed. Read-only Vitest 5 config resolution from packages/portal now loads test/postgres.ts, test/setup.ts, and the development condition. git check-ignore confirms .vitest/ covers root and package-local artifacts.

The reported 49/49 package-scoped pass covers the original failing path; I did not rerun the suite. No new blockers found. Happy for this to merge once CI is green.

Standards: 0 findings. Spec: 0 remaining findings.

@allisonmahmood

Copy link
Copy Markdown
Owner Author

Astra review

Reviewed origin/deps/vite-8...a282c80dabc04c917e2bfa3dba3c17522114b154 against the PR description and the Vitest 5 migration guide. One pass, no subagents or file edits.

Standards

No merge-blocking method or YAGNI findings. The portal config reuses the existing shared test configuration. The .vitest/ ignore follows the migration guide's artifact-directory change. Neither introduces unnecessary machinery.

Spec

No merge-blocking intent findings. All 17 direct Vitest declarations move to ^5.0.1, and the lockfile updates the corresponding @effect/vitest peer resolutions. The existing Node requirements, CI versions, and locked Vite 8.3.0 satisfy the migration prerequisites. The added portal config addresses Vitest 5's removal of parent-directory config discovery. I found no incompatible migration-sensitive API usage in the inspected tests and configurations.

Static review only. This worktree has no installed dependencies, so I did not rerun tests. CI for the reviewed commit was still queued or running when checked.

Summary: Standards 0 blocking findings; Spec 0 blocking findings. No worst issue on either axis.

@allisonmahmood

Copy link
Copy Markdown
Owner Author

Opus review

Reviewed origin/deps/vite-8...HEAD at c221593. The portal-config blocker from the earlier passes is fixed; not re-litigating it.

Independently checked against the Vitest 5 guide:

  • Enumerated all 18 packages/apps with a test script: each now has a local vitest.config.ts. scripts/dev has *.test.ts files but no test script, so it is only reached by the root config's **/src/**/*.test.ts include — correct.
  • packages/portal/vitest.config.ts uses the Postgres-backed re-export, matching serving and apps/server, which is right given portal's inject("postgres").
  • No VITEST_POOL_ID/VITEST_WORKER_ID arithmetic anywhere, so the 0→1 base change is inert. No test.sequential, no removed entry points, no resolveConfig, no -t/testNamePattern in scripts or workflows. The one expect.poll (test/browser-tier1/tier1.spec.ts:492) is Playwright's — the body's "no expect.poll" is right in effect, wrong in detail.
  • clearMocks: true only reaches packages/patchy/src/clientTransport.test.ts; its vi.fn()s are created inside each test and mockClear never removes implementations. Safe.
  • TestProject from vitest/node (test/postgres.ts:7, test/clerk.ts:1) and project.provide/inject are unchanged in 5. Node floor 22.12 sits under the repo's >=22.22.0 and CI's 22.22/24.

Findings:

  1. Non-blocking, Standards (CLAUDE.md "Hit every surface" → the dev loop). Vitest 5 turns "a package with a test script carries its own config" into a hard rule with a silent failure mode: no error, just a suite running without test/setup.ts's fetch guard and without the Postgres global setup. docs/DEVELOPMENT.md says nothing about per-package configs. One line in its test section stops the next package repeating exactly the bug this PR had to fix.

  2. Non-blocking. CI runs pnpm test (ci.yml:37), the root config only; turbo run test lives in scripts/test-all.sh:20, which CI never invokes. No CI job exercises per-package config discovery, so the portal regression was invisible to CI and the next one will be too. Follow-up, not this PR.

  3. Non-blocking, follow-up. ^5.0.1 is now written out 18 times while pnpm-workspace.yaml already has a catalog; vitest is a catalog candidate. Out of scope here under one-concern-per-PR. Related: packages/api and packages/core declare no vitest and silently take the root's.

Would merge on green CI.

@allisonmahmood

Copy link
Copy Markdown
Owner Author

Disposition for the Astra and Opus reviews: docs/DEVELOPMENT.md now states that every tested package carries its own vitest.config.ts and why. Kept as is, as follow-ups outside this PR: a CI job that exercises per-package config discovery, and moving vitest into the pnpm catalog. The body's expect.poll line refers to Vitest's matcher; the one hit in the tree is Playwright's.

@github-actions github-actions Bot added the area:docs Touches the docs area label Sep 19, 2026
@github-actions github-actions Bot added area:primitives Patch tables and files area:integrations Company connections and integration implementations area:ui Portal and first-party browser pages, shared rendering and styles labels Sep 19, 2026
@allisonmahmood
allisonmahmood force-pushed the deps/vite-8 branch 2 times, most recently from 62da272 to 024566c Compare September 19, 2026 13:44
Base automatically changed from deps/vite-8 to main September 19, 2026 13:52
allisonmahmood and others added 3 commits September 19, 2026 15:52
Vitest 5 no longer looks up ancestor configs, so a package-scoped run in portal lost the Postgres setup; re-export the shared config like every other package. Ignore the new .vitest artifact directory.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@allisonmahmood
allisonmahmood merged commit 649f6d0 into main Sep 19, 2026
8 checks passed
@allisonmahmood
allisonmahmood deleted the deps/vitest-5 branch September 19, 2026 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:ci CI, shared testing infrastructure, development scripts and tooling area:cli Touches the cli area area:docs Touches the docs area area:integrations Company connections and integration implementations area:primitives Patch tables and files area:server Touches the server area area:ui Portal and first-party browser pages, shared rendering and styles size:s Under 100 changed lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant