Skip to content

chore(deps-dev): upgrade vitest to v5 - #1681

Merged
erunion merged 1 commit into
nextfrom
erunion/upgrade-vitest-v5-1a6c
Nov 4, 2026
Merged

erunion merged 1 commit into
nextfrom
erunion/upgrade-vitest-v5-1a6c

Conversation

@erunion

@erunion erunion commented Nov 3, 2026

Copy link
Copy Markdown
Member

🎯 What does this PR do?

Upgrades Vitest from 4.1.12 to 5.1.0, along with @vitest/coverage-v8 and @vitest/ui so the peer versions stay in lockstep. Vite 6.4.5 and Node 22.13 (the Docker image) already meet Vitest 5's floors (Vite >= 6.4, Node >= 22.12).

Vitest 5 changes that this repo actually hits:

  • Custom matchers now augment Matchers<R, T>. vitest.d.ts was renamed to vitest.matchers.d.ts because baseUrl: "." would resolve a root vitest.d.ts as the vitest module and replace the package types. The matcher implementation imports MatcherResult from vitest instead of @vitest/expect, which Vitest no longer depends on.
  • CI (CI=true) fails when a snapshot file contains entries no test claims. Unused stripComments snapshots are removed. The skipped table-of-contents snapshot is kept, with its key joined by > so the skipped test still owns it.
  • Generated artifacts now live under .vitest/, which is gitignored.

clearMocks now defaults to true. The suite passes with that default, so it is left on.

🧪 QA tips

  • npx vitest run — 4382 passed, 56 skipped
  • CI=true npx vitest run — same result, including the obsolete-snapshot check
  • npm run test.ui still opens the UI; Vitest 5 requires the token printed in the terminal

📸 Screenshot or Loom

No UI change. Verification is the unit suite above.

Open in Web Open in Cursor 

Vitest 5 requires the matching coverage and UI packages, types custom
matchers on Matchers, and fails CI when snapshots are obsolete. Drop
unused snapshots and keep the skipped table-of-contents snapshot under
the ` > ` joined name.

Co-authored-by: Jon Ursenbach <erunion@users.noreply.github.com>
@greptile-apps

greptile-apps Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable bugs were found.

Reviews (1) · Last reviewed commit: "chore(deps-dev): upgrade vitest to v5" · Reviewed by Greptile

@erunion erunion added the dependencies Pull requests that update a dependency file label Nov 4, 2026
@erunion
erunion merged commit 0946e08 into next Nov 4, 2026
10 checks passed
@erunion
erunion deleted the erunion/upgrade-vitest-v5-1a6c branch November 4, 2026 00:29
rafegoldberg pushed a commit that referenced this pull request Nov 9, 2026
## Version 16.2.1
### 🛠 Fixes & Updates

* address flagged CodeQL alerts ([#1682](#1682)) ([3b14a86](3b14a86))
* move lint and format to oxlint and oxfmt ([#1680](#1680)) ([85c915b](85c915b))
* **deps:** patch Dependabot security vulnerabilities ([#1679](#1679)) ([bfc9c1b](bfc9c1b))
* pulling dependabot updates back a bit ([a9906c3](a9906c3))
* **mdxish:** space callouts under tight list items ([#1671](#1671)) ([f21e0d8](f21e0d8))
* **table:** stop centering unaligned headers ([#1670](#1670)) ([139d238](139d238))
* **deps-dev:** upgrade vitest to v5 ([#1681](#1681)) ([0946e08](0946e08))

<!--SKIP CI-->
@rafegoldberg

Copy link
Copy Markdown
Collaborator

This PR was released!

🚀 Changes included in v16.2.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants