Skip to content

Conversation

@OrbisK
Copy link
Member

@OrbisK OrbisK commented Nov 27, 2025

πŸ”— Linked issue

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

This should increase test/ci speed because vitest only need to start once.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@benjamincanac
Copy link
Member

Thanks a lot for this @OrbisK! I did try before without success.. I've updated the PR to fix lint and added extends: true on both projects, can you confirm this is correct?

Also, would you know how to migrate to Vitest v4? When I try I get this error:

FAIL   vue  test/components/User.spec.ts [ test/components/User.spec.ts ]
Error: Cannot find module '/test/utils/mount' imported from '/Users/benjamincanac/GitHub/nuxt/ui/test/components/User.spec.ts'
 ❯ test/components/User.spec.ts:3:1
      1| import { describe, it, expect } from 'vitest'
      2| import { axe } from 'vitest-axe'
      3| import { mountSuspended } from '@nuxt/test-utils/runtime'
       | ^

@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 27, 2025

npm i https://pkg.pr.new/@nuxt/ui@5546

commit: 28f1a05

@OrbisK
Copy link
Member Author

OrbisK commented Nov 27, 2025

I've updated the PR to fix lint and added extends: true on both projects, can you confirm this is correct?

should be correct.

Also, would you know how to migrate to Vitest v4? When I try I get this error:

I can have a look. can you push what you have?

Copy link
Member

I've pushed my changes already, do you want me to push this?

diff --git a/package.json b/package.json
index e5b1077fd..0c64a1175 100644
--- a/package.json
+++ b/package.json
@@ -178,7 +178,7 @@
     "happy-dom": "^20.0.10",
     "nuxt": "^4.2.1",
     "release-it": "^19.0.6",
-    "vitest": "^3.2.4",
+    "vitest": "^4.0.14",
     "vitest-axe": "^0.1.0",
     "vitest-environment-nuxt": "^1.0.1",
     "vue-tsc": "^3.1.5"

@OrbisK
Copy link
Member Author

OrbisK commented Nov 27, 2025

I've pushed my changes already, do you want me to push this?

diff --git a/package.json b/package.json
index e5b1077fd..0c64a1175 100644
--- a/package.json
+++ b/package.json
@@ -178,7 +178,7 @@
     "happy-dom": "^20.0.10",
     "nuxt": "^4.2.1",
     "release-it": "^19.0.6",
-    "vitest": "^3.2.4",
+    "vitest": "^4.0.14",
     "vitest-axe": "^0.1.0",
     "vitest-environment-nuxt": "^1.0.1",
     "vue-tsc": "^3.1.5"

ill upgrade locally πŸ‘πŸ½

@OrbisK
Copy link
Member Author

OrbisK commented Nov 27, 2025

@benjamincanac I think I have a "fix"

Tests are green but i get these logs:

image

BTW @nuxt/test-utils vitest 4 support is not merged yet: nuxt/test-utils#1481


My "fix":

image

Copy link
Member

Oh yes you're right, we need to wait for @nuxt/test-utils support! I guess we can merge this as-is then and update once released with your fix?

Copy link
Member

@benjamincanac benjamincanac left a comment

Choose a reason for hiding this comment

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

Thanks again! 😊

@benjamincanac benjamincanac merged commit 9002f27 into nuxt:v4 Nov 27, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v4 #4488

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants