Repository navigation
chore(deps): migrate vitest imports to vite-plus/test - #3377
Conversation
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:
If anything needs adjusting we'll leave comments here. Thanks again! |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
|
No actionable comments were generated in the recent review.
|
| 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
- npmx-dev/npmx.dev#2717: This PR adds Vitest tests in files whose test imports now use
vite-plus/test.
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: 
4
-
Full details: Linked Issues check
-
Explanation
Issue
#3378requires migration from directvitestimports tovite-plus/test. The reviewed changes update the repository test files and theCONTRIBUTING.mdexample. They remove the directvitestdevelopment dependency and add lint errors forvitestandvitest/*imports. The@nuxt/test-utilspatch also recognisesvite-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-utilscompatibility 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.
e18e dependency analysisNo dependency warnings found. |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
cb3d5d2 to
ab94629
Compare
ab94629 to
d3f4931
Compare
f91ca8a to
a1c4177
Compare
trueberryless
left a comment
There was a problem hiding this comment.
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/.
Co-authored-by: Felix Schneider <99918022+trueberryless@users.noreply.github.com>
🔗 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-utilsto work with vite-plus/test. (This should be supported directly in the future version@nuxt/test-utils@4.4.0nuxt/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.