Skip to content

Bump @nuxt/test-utils from 3.23.0 to 4.0.0#265

Open
dependabot[bot] wants to merge 1 commit intomainfrom
dependabot/npm_and_yarn/nuxt/test-utils-4.0.0
Open

Bump @nuxt/test-utils from 3.23.0 to 4.0.0#265
dependabot[bot] wants to merge 1 commit intomainfrom
dependabot/npm_and_yarn/nuxt/test-utils-4.0.0

Conversation

@dependabot
Copy link
Copy Markdown
Contributor

@dependabot dependabot bot commented on behalf of github Feb 19, 2026

Bumps @nuxt/test-utils from 3.23.0 to 4.0.0.

Release notes

Sourced from @​nuxt/test-utils's releases.

v4.0.0

4.0.0 is the next major release.

👀 Highlights

We're releasing Nuxt Test Utils v4, with support for Vitest v4. 🚀

Better mocking support

The biggest improvement in this release is how mocking works. Nuxt initialization has been moved from setupFiles to the beforeAll hook (#1516), which means vi.mock and mockNuxtImport calls now take effect before Nuxt starts. This fixes a long-standing issue where mocks for composables used in middleware or plugins wouldn't apply reliably (#750, #836, #1496).

On top of that, mockNuxtImport now passes the original implementation to the factory function (#1552), making partial mocking much more natural:

mockNuxtImport('useRoute', original => vi.fn(original))
it('my test', async () => {
vi.mocked(useRoute).mockImplementation(
(...args) => ({ ...vi.mocked(useRoute).getMockImplementation()!(...args), path: '/mocked' }),
)
const wrapper = await mountSuspended(MyComponent)
expect(wrapper.find('#path').text()).toBe('/mocked')
})

registerEndpoint improvements

registerEndpoint now works correctly with query parameters in URLs (#1560), and endpoints registered in setup files are no longer lost when modules reset (#1549).

🚧 Migration

@nuxt/test-utils v4 contains a few breaking changes, almost all related to requiring at least vitest v4 as a peer dependency (if you are using vitest). It replaces vite-node with Vite's native Module Runner and simplifies pool configuration.

This will mean improvements for test performance and mocking, but does require some changes to your test code.

[!TIP] Most of the changes below are straightforward. The biggest thing to watch out for is code that runs at the top level of a describe block — see below.

Update your dependencies

Update vitest and its companion packages together:

{
  "devDependencies": {
-   "@nuxt/test-utils": "^3.x",
-   "vitest": "^3.x",
-   "@vitest/coverage-v8": "^3.x"
+   "@nuxt/test-utils": "^4.0",
</tr></table> 

... (truncated)

Commits
  • f2b23f6 v4.0.0
  • 6b88454 feat(e2e): support setup and teardown timeouts in setupBun (#1578)
  • ca06966 refactor(runtime): remove unnecessary querySelector (#1577)
  • 32482f1 chore(deps): update devdependency vue-router to v5 (#1572)
  • c04a336 chore(deps): update devdependency jsdom to v28 (#1576)
  • 53d6592 chore(deps): update all non-major dependencies (#1575)
  • c506ac5 chore(deps): update autofix-ci/action digest to 7a166d7 (#1573)
  • daa13e1 chore(deps): update devdependency oxc-parser to v0.112.0 (#1574)
  • f388d6d chore(deps): update all non-major dependencies (#1571)
  • 34f631e fix(config): respect include options in non nuxt environment simple setup (#1...
  • Additional commits viewable in compare view

Dependabot compatibility score

You can trigger a rebase of this PR 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)

Note
Automatic rebases have been disabled on this pull request as it has been open for over 30 days.

@dependabot dependabot bot added dependencies Pull requests that update a dependency file javascript Pull requests that update javascript code labels Feb 19, 2026
@dependabot dependabot bot force-pushed the dependabot/npm_and_yarn/nuxt/test-utils-4.0.0 branch from ce9a7a3 to 3e4dfbb Compare March 2, 2026 10:29
@VD39
Copy link
Copy Markdown
Owner

VD39 commented Mar 2, 2026

@dependabot rebase

Bumps [@nuxt/test-utils](https://github.com/nuxt/test-utils) from 3.23.0 to 4.0.0.
- [Release notes](https://github.com/nuxt/test-utils/releases)
- [Commits](nuxt/test-utils@v3.23.0...v4.0.0)

---
updated-dependencies:
- dependency-name: "@nuxt/test-utils"
  dependency-version: 4.0.0
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot bot force-pushed the dependabot/npm_and_yarn/nuxt/test-utils-4.0.0 branch from 3e4dfbb to df380d2 Compare March 2, 2026 11:35
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.

1 participant