Skip to content

build(deps-dev): Bump Vitest from v3.2.4 to v4.0.7 (#2752)#2807

Merged
KATO-Hiro merged 5 commits intostagingfrom
#2752
Nov 7, 2025
Merged

build(deps-dev): Bump Vitest from v3.2.4 to v4.0.7 (#2752)#2807
KATO-Hiro merged 5 commits intostagingfrom
#2752

Conversation

@KATO-Hiro
Copy link
Collaborator

@KATO-Hiro KATO-Hiro commented Nov 7, 2025

close #2752

Summary by CodeRabbit

  • Chores

    • Upgraded testing framework from v3.2.4 to v4.0.7
    • Updated minimum Node.js requirement from 18.16.0 to 20.0.0
  • Documentation

    • Added comprehensive migration guide covering breaking changes, coverage configuration updates, mock/spy behavior adjustments, worker/thread setting changes, phased migration and validation steps, and CI/local upgrade guidance

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 7, 2025

Walkthrough

Vitest was upgraded from v3.2.4 to v4.0.7 and Node engine requirement raised from >=18.16.0 to >=20.0.0. A new migration plan document was added describing breaking changes, migration phases, coverage and mock adjustments, and validation steps.

Changes

Cohort / File(s) Summary
Vitest Upgrade Documentation
docs/dev-notes/2025-11-07/bump-vitest-from-v3.x-to-v4.x/plan.md
Added migration plan detailing breaking changes, Node ≥20 requirement, coverage config removals/changes, mock/spy behavior adjustments, worker settings unification, phased migration checklist, validation commands, and references.
Dependency & Engine Bumps
package.json
Updated vitest, @vitest/coverage-v8, and @vitest/ui from 3.2.44.0.7; updated engines.node from >=18.16.0>=20.0.0.

Sequence Diagram(s)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Pay attention to:
    • CI and Docker Node versions and any pinned images or matrix entries.
    • Coverage config usage in repository (search for coverage.all, coverage.extensions, coverage.ignoreEmptyLines) and vite.config.ts changes.
    • Tests relying on v3 mock behaviors (global automock assumptions, vi.restoreAllMocks semantics).

"I nibble notes and patch the test,
Vitest leaps forward—no time to rest.
Node grows taller, coverage sings,
Mocks rearranged with nimble wings.
Hopping green builds, I do my best." 🐇✨

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main change: bumping Vitest from v3.2.4 to v4.0.7 as a dependency update.
Linked Issues check ✅ Passed The pull request updates Vitest from v3.2.4 to v4.0.7 in package.json and includes comprehensive migration documentation, directly addressing issue #2752's objective to upgrade Vitest from 3.x to 4.x.
Out of Scope Changes check ✅ Passed All changes are directly related to the Vitest upgrade: version bumps in package.json and migration planning documentation. No unrelated changes detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch #2752

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 5ba3b4b and b52740c.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (1)
  • package.json (3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: preview
🔇 Additional comments (2)
package.json (2)

46-47: Vitest versions locked consistently to v4.0.7 across all packages.

The version updates are properly aligned: @vitest/coverage-v8, @vitest/ui, and vitest are all pinned to 4.0.7. This ensures the testing ecosystem remains cohesive and avoids version mismatches that could cause subtle failures.

Also applies to: 70-70


100-100: Node engine requirement correctly bumped to >=20.0.0 for Vitest v4 compatibility.

The Node.js requirement aligns with Vitest v4's breaking changes. However, ensure this change is coordinated with CI configuration and any environment documentation across the repository.


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

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
docs/dev-notes/2025-11-07/bump-vitest-from-v3.x-to-v4.x/plan.md (1)

1-50: Documentation quality is excellent; structure and examples are well-organized.

The migration guide comprehensively covers breaking changes (Node version, coverage config, mock API behavior), provides concrete code examples, and includes a detailed phase-based implementation checklist. The inclusion of lessons learned (lines 383–413) and test statistics (1640 tests passing) demonstrates thorough validation.

Suggestion: Consider creating a concise migration summary at the top (e.g., a 3–5 bullet summary) for developers who need a quick reference. This would complement the existing detailed sections.

Example addition after the table of contents (after line 17):

## 🚀 Quick Reference (TL;DR)
- **Node requirement**: >=20.0.0 (was >=18.16.0)
- **All Vitest packages**: Update to v4.0.7
- **Coverage config**: May need updates (removed `coverage.all`, `coverage.extensions`)
- **Mock API**: `vi.restoreAllMocks()` now restores spies only; use `vi.clearAllMocks()` and `vi.resetAllMocks()` explicitly
- **Breaking change risk**: Low for this project (existing tests all pass)

This would make the guide more accessible to team members scanning quickly.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 5856984 and 32c7868.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (2)
  • docs/dev-notes/2025-11-07/bump-vitest-from-v3.x-to-v4.x/plan.md (1 hunks)
  • package.json (3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: preview
🔇 Additional comments (1)
docs/dev-notes/2025-11-07/bump-vitest-from-v3.x-to-v4.x/plan.md (1)

385-392: Retrospective analysis demonstrates low migration risk.

The lessons learned section confirms that all 1640 existing tests passed with v4.0.7, coverage configuration did not require updates (deprecated options were not in use), and the team was already on Node v22—satisfying v4's >=20.0.0 requirement. This validates the upgrade safety.

Copy link
Collaborator Author

@KATO-Hiro KATO-Hiro left a comment

Choose a reason for hiding this comment

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

LGTM

@KATO-Hiro KATO-Hiro merged commit 8d4aa54 into staging Nov 7, 2025
3 checks passed
@KATO-Hiro KATO-Hiro deleted the #2752 branch November 7, 2025 11:05
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.

[Dep] Vitest を 3.x から 4.x にアップグレードしましょう

1 participant