Skip to content

chore(deps-dev): bump vitest from 3.2.4 to 4.1.4#648

Open
dependabot[bot] wants to merge 1 commit intomainfrom
dependabot/npm_and_yarn/vitest-4.1.4
Open

chore(deps-dev): bump vitest from 3.2.4 to 4.1.4#648
dependabot[bot] wants to merge 1 commit intomainfrom
dependabot/npm_and_yarn/vitest-4.1.4

Conversation

@dependabot
Copy link
Copy Markdown
Contributor

@dependabot dependabot bot commented on behalf of github Apr 9, 2026

Bumps vitest from 3.2.4 to 4.1.4.

Release notes

Sourced from vitest's releases.

v4.1.4

   🚀 Experimental Features

   🐞 Bug Fixes

    View changes on GitHub

v4.1.3

   🚀 Experimental Features

   🐞 Bug Fixes

    View changes on GitHub

v4.1.2

This release bumps Vitest's flatted version and removes version pinning to resolve flatted's CVE related issues (vitest-dev/vitest#9975).

... (truncated)

Commits
  • ac04bac chore: release v4.1.4
  • 82c858d chore: Remove no-op function in plugin config logic (#8501)
  • d4fbb5c feat(experimental): support aria snapshot (#9668)
  • b77de96 feat(reporter): add filterMeta option to json reporter (#10078)
  • a120e3a feat(experimental): expose assertion as a public field (#10095)
  • 5375780 feat(coverage): default to text reporter skipFull if agent detected (#10018)
  • a1b5f0f fix: make expect(..., message) consistent as error message prefix (#10068)
  • 203f07a fix: use "black" foreground for labeled terminal message to ensure contrast (...
  • 2dc0d62 chore: release v4.1.3
  • 7827363 feat: add experimental.preParse flag (#10070)
  • Additional commits viewable in compare view
Maintainer changes

This version was pushed to npm by [GitHub Actions](https://www.npmjs.com/~GitHub Actions), a new releaser for vitest since your current version.


Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [vitest](https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest) from 3.2.4 to 4.1.4.
- [Release notes](https://github.com/vitest-dev/vitest/releases)
- [Commits](https://github.com/vitest-dev/vitest/commits/v4.1.4/packages/vitest)

---
updated-dependencies:
- dependency-name: vitest
  dependency-version: 4.1.4
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot bot added dependencies Pull requests that update a dependency file javascript Pull requests that update Javascript code labels Apr 9, 2026
@dependabot dependabot bot requested a review from a team as a code owner April 9, 2026 17:43
@dependabot dependabot bot added dependencies Pull requests that update a dependency file javascript Pull requests that update Javascript code labels Apr 9, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 9, 2026

📝 Walkthrough

Summary by CodeRabbit

  • Chores
    • Updated development testing infrastructure dependency to the latest version.

Walkthrough

The change updates the vitest development dependency version constraint in package.json from ^3.2.4 to ^4.1.4. This adjusts the test runner version used by the test script, while all other configuration, scripts, and dependencies remain unchanged.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: updating vitest from version 3.2.4 to 4.1.4 in devDependencies.
Description check ✅ Passed The description directly relates to the changeset by providing release notes, commits, and relevant context for the vitest version bump.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dependabot/npm_and_yarn/vitest-4.1.4

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

Copy link
Copy Markdown

@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: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@package.json`:
- Line 44: Update the Vite dependency in package.json to a version compatible
with Vitest v4 by changing the "vite" entry (currently "vite": "^5.4.11") to at
least v6 (for example "vite": "^6.0.0"), then run dependency install and verify
tests; ensure the package.json "vite" field is the only change and update
lockfile accordingly.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: lokalise/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 491e7bbd-6870-4612-8c69-f0d2973196a2

📥 Commits

Reviewing files that changed from the base of the PR and between 64a802f and 76b998d.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (1)
  • package.json

"typescript": "^5.5.4",
"vite": "^5.4.11",
"vitest": "^3.2.4"
"vitest": "^4.1.4"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🌐 Web query:

Vitest v4 migration guide breaking changes from v3

💡 Result:

Vitest v4 migration (from v3): breaking changes / required updates

  • Prereqs: Vitest 4 requires Node.js ≥ 20 and Vite ≥ 6. Update these first. [1]
  • Coverage (V8 provider):
    • Coverage remapping changed (expect different numbers). [1]
    • Updated ignore-hints behavior; coverage.ignoreEmptyLines removed; coverage.experimentalAstAwareRemapping removed (now default). [1]
    • coverage.all and coverage.extensions removed; you should set coverage.include explicitly (v4 defaults to “only covered files”). [1]
  • Default test.exclude is much less aggressive: by default it mainly excludes node_modules and .git, so folders like dist/, cypress/, and various dot-folders/config files may now be considered unless you add exclusions or use test.dir. [1]
  • Mocking changes (can break snapshots/assertions):
    • vi.spyOn/vi.fn now support constructors; arrow-function implementations will fail when called with new. [1]
    • vi.fn().getMockName() default changes (can affect snapshots). [1]
    • vi.restoreAllMocks() no longer resets spy state the same way (and automocks aren’t affected). [1]
    • vi.fn().mock.invocationCallOrder now starts at 1 (Jest-aligned). [1]
  • Pools/workers rework (config renames/removals):
    • maxThreads/maxForksmaxWorkers (env vars changed too). [1]
    • singleThread/singleForkmaxWorkers: 1, isolate: false (add vi.resetModules() in setup if you relied on resets). [1]
    • poolOptions removed; many pool options are now top-level; VM pool memoryLimitvmMemoryLimit. [1]
  • CLI behavior: --standalone + filename filter now runs matched files immediately (v3 ignored the filter). [1]
  • Runtime internals: Vitest replaces vite-node usage with Vite’s Module Runner:
    • vitest/execute entry removed; env var VITE_NODE_DEPS_MODULE_DIRECTORIESVITEST_MODULE_DIRECTORIES; some custom-environment fields change. [1]
  • Config/workspace: workspace is replaced by/renamed to projects (if you still used the old pattern). [1]
  • Browser mode provider changes: provider setup moved to separate packages (e.g. @vitest/browser-playwright), preview is no longer the default, and imports like @vitest/browser/context should move to vitest/browser (transition period noted). [1][2]
  • Reporters:
    • Legacy reporter hooks (onCollected, onFinished, etc.) removed; basic reporter removed; verbose formatting behavior changed (use tree reporter to restore prior style). [1][2]
  • Snapshots: snapshots including custom elements now print shadow root by default (printShadowRoot: false to revert). [1]
  • Deprecated APIs removed: e.g. poolMatchGlobs, environmentMatchGlobs, old deps.* options in favor of server.deps.*, browser.testerScripts, minWorkers, and passing a test-options object as the 3rd arg to test/describe. [1]

Primary reference: Vitest’s official Migration Guide (Migrating to Vitest 4.0). [1]

Sources: [1] Vitest Migration Guide, [2] “Vitest 4.0 is out!” announcement.


🌐 Web query:

Vitest 4 globals API changes and vitest/globals types compatibility

💡 Result:

Vitest v4 “globals” API (runtime) — what changed

  • Vitest still does not enable Jest-like globals by default; you must opt in via test.globals: true (config) or --globals (CLI). (vitest.dev)
  • In the v4 migration, one “globals-adjacent” breaking change that often surfaces in test files is that test() / describe() no longer accept the test-options object as a 3rd argument (it must be the 2nd argument now). (vitest.dev)
  • Vitest v4 also removed deprecated types, which (among other things) fixed an issue where Vitest could accidentally pull in @types/node. If you relied on Node typings being implicitly present, you may now need to add them explicitly in your TS config. (vitest.dev)

vitest/globals TypeScript types — compatibility rules / common pitfalls

  • To get TypeScript to recognize describe/it/expect/vi as globals, add this to the relevant tsconfig:
  • If you customized "typeRoots", you must ensure node_modules is still discoverable (otherwise TS may fail to find vitest/globals). (vitest.dev)
  • Once you include "vitest/globals" in a tsconfig that covers non-test files, those files will also type-check with describe/it/expect available, and TypeScript can’t “only apply types to *.spec.ts” within a single TS program. Maintainer guidance: you basically can’t scope it that way; prefer importing from vitest and keeping globals off. (github.com)

Practical recommendations (v4-safe)

  • Best isolation: keep test.globals = false, and in each test file import { describe, it, expect, vi } from 'vitest'. (github.com)
  • If you must use globals, use a separate TS project/tsconfig for tests (so app code isn’t compiled with vitest/globals). (This is the standard workaround implied by the TS limitation noted above.) (github.com)

Citations:


🏁 Script executed:

#!/bin/bash
# Check package.json for Node.js and Vite versions
echo "=== package.json versions ==="
cat package.json | grep -E '"(node|vite|engines)"' -A 2

# Check for vitest/vite config files
echo -e "\n=== Config files present ==="
ls -la | grep -E '(vitest|vite)\.config'

# Check tsconfig.json for types configuration
echo -e "\n=== tsconfig.json content ==="
if [ -f tsconfig.json ]; then
  cat tsconfig.json
fi

# Check test files for test-options patterns (3rd argument usage)
echo -e "\n=== Test file patterns (3rd argument in test/describe) ==="
rg -n "describe\s*\([^)]+,\s*[^)]+,\s*\{" --type js --type ts || echo "No 3rd-arg pattern found"
rg -n "it\s*\([^)]+,\s*[^)]+,\s*\{" --type js --type ts || echo "No 3rd-arg pattern found"

Repository: lokalise/npm-package-template

Length of output: 803


🏁 Script executed:

#!/bin/bash
# Check vite.config.ts content
echo "=== vite.config.ts content ==="
cat vite.config.ts

# Check if any test files import `@types/node` or use Node types
echo -e "\n=== Node types usage in test files ==="
rg "import.*node" src/index.test.ts || echo "No explicit node imports in test file"
cat src/index.test.ts | head -20

Repository: lokalise/npm-package-template

Length of output: 659


Update Vite to version 6 or higher before merging.

Vitest v4 requires Vite ≥ 6, but package.json specifies "vite": "^5.4.11". This incompatibility will prevent the project from running. Update the vite dependency to at least v6 (e.g., "vite": "^6.0.0").

The project's Node.js version (≥20), vitest/globals TypeScript configuration, and test files are already compatible with Vitest v4.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@package.json` at line 44, Update the Vite dependency in package.json to a
version compatible with Vitest v4 by changing the "vite" entry (currently
"vite": "^5.4.11") to at least v6 (for example "vite": "^6.0.0"), then run
dependency install and verify tests; ensure the package.json "vite" field is the
only change and update lockfile accordingly.

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 javascript Pull requests that update Javascript code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants