Skip to content

chore(deps): migrate vitest imports to vite-plus/test - #3377

Merged
trueberryless merged 3 commits into
npmx-dev:mainfrom
cylewaitforit:migrate-vite-plus-test
Oct 31, 2026
Merged

trueberryless merged 3 commits into
npmx-dev:mainfrom
cylewaitforit:migrate-vite-plus-test

Conversation

@cylewaitforit

@cylewaitforit cylewaitforit commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

🔗 Linked issue

closes #3378

🧭 Context

This Pr migrates vitest imports to use vite-plus/test.

📚 Description

This Pr migrates vitest imports to use vite-plus/test as recommending in the vite-plus migration guide. #3377

This required patching @nuxt/test-utils to work with vite-plus/test. (This should be supported directly in the future version @nuxt/test-utils@4.4.0 nuxt/test-utils#1862 . Thanks to @danielroe 's nuxt/test-utils#1861)

It also includes a lint change to attempt to catch any usage of the previous pattern.

As stated by the vite-plus migration guide this can be helpful in reducing the number of direct imports required by a project.

@agentscanapp

agentscanapp Bot commented Oct 31, 2026

Copy link
Copy Markdown

Thanks for opening this pull request! 🎉

We really appreciate you taking the time to contribute, @cylewaitforit.

A maintainer will take a look as soon as they can. In the meantime, please make sure that:

  • the description explains what changed and why
  • any related issues are linked
  • existing tests still pass

If anything needs adjusting we'll leave comments here. Thanks again!

@vercel

vercel Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
npmx.dev Ready Ready Preview Oct 31, 2026 5:24pm UTC
2 Skipped Deployments
Project Deployment Actions Updated
docs.npmx.dev Ignored Ignored Preview Oct 31, 2026 5:24pm UTC
npmx-lunaria Ignored Ignored Oct 31, 2026 5:24pm UTC

Request Review

@coderabbitai

coderabbitai Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between d3f4931 and a1c4177.

Files ignored due to path filters: 1
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
Files selected for processing: 2
  • CONTRIBUTING.md
  • vite.config.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 4 remain after this review.

Summary

Summary by CodeRabbit

  • Chores
    • Updated the test suite to use vite-plus/test and removed the separate Vitest development dependency.
    • Added a lint check to prevent tests from importing directly from Vitest.
    • Improved compatibility with vite-plus/test in the Nuxt test setup.

The test suite now imports test APIs from vite-plus/test instead of vitest. The direct vitest development dependency is removed. The Nuxt mock plugin recognises the new import source, and the lint configuration rejects direct vitest imports.

Changes: Vite Plus test import migration

Layer / File(s) Summary
Dependency and Nuxt mock updates
package.json, patches/@nuxt__test-utils@4.1.0.patch
The direct vitest development dependency is removed. The Nuxt mock plugin recognises imports from vite-plus/test when detecting vi imports.
Test import updates
test/nuxt/**/*.spec.ts, test/unit/**/*.spec.ts
Test utilities now come from vite-plus/test. Test cases and assertions are otherwise unchanged.
Lint rule and test documentation
vite.config.ts, CONTRIBUTING.md
The lint configuration rejects imports from vitest and its subpaths. The unit-test example uses vite-plus/test.

Possibly related PRs

Suggested reviewers: fengmk2

Merge Risk: Minimal · up to a1c41

The lint restriction and updated test example present no established merge-blocking issue. Merge after normal checks pass.

Pre-merge checks: Passed 4
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: migrating Vitest imports to vite-plus/test.
Description check Passed The description directly explains the migration, the @nuxt/test-utils compatibility patch, and the lint rule update. It is related to the changeset.
Linked Issues check Passed Issue #3378 requires migration from direct vitest imports to vite-plus/test. The reviewed changes update the repository test files and the CONTRIBUTING.md example. They remove the direct `vitest…
Out of Scope Changes check Passed The changes remain within issue #3378. Test import updates, the dependency removal, lint protection, documentation update, and the @nuxt/test-utils compatibility patch all support the import migrati…
Full details: Linked Issues check

Explanation

Issue #3378 requires migration from direct vitest imports to vite-plus/test. The reviewed changes update the repository test files and the CONTRIBUTING.md example. They remove the direct vitest development dependency and add lint errors for vitest and vitest/* imports. The @nuxt/test-utils patch also recognises vite-plus/test, which supports the migration. No other coding requirements are stated.

Full details: Out of Scope Changes check

Explanation

The changes remain within issue #3378. Test import updates, the dependency removal, lint protection, documentation update, and the @nuxt/test-utils compatibility patch all support the import migration. The summary does not establish an unrelated feature or behaviour change.

Finishing Touches
Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@github-actions

Copy link
Copy Markdown

e18e dependency analysis

No dependency warnings found.

@codecov

codecov Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@trueberryless trueberryless left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the PR, @cylewaitforit !

Everything looks good. I added one commit that also changes the CONTRIBUTING.md file and applies the new lint rule to the whole repo, not just test/.

@trueberryless
trueberryless added this pull request to the merge queue Oct 31, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 31, 2026
@trueberryless
trueberryless added this pull request to the merge queue Oct 31, 2026
Merged via the queue into npmx-dev:main with commit b10e483 Oct 31, 2026
25 checks passed
@cylewaitforit
cylewaitforit deleted the migrate-vite-plus-test branch October 31, 2026 17:45
trueberryless added a commit to BittuBarnwal7479/npmx.dev that referenced this pull request Oct 31, 2026
Co-authored-by: Felix Schneider <99918022+trueberryless@users.noreply.github.com>

This branch was successfully deployed

2 active (1 outdated) deployments
Preview – npmx.dev — a1c41779 Deployed Oct 31, 2026 by vercel[bot]
Preview – docs.npmx.dev — d3f4931a Deployed Oct 31, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate vitest imports to vite-plus/test

2 participants