-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrating from nuxt-vitest
#644
Comments
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
After looking through the thread again, I tried to update vitest, though it isn't listed in outdated. appears that @nuxt/devtools is behind on updating the vite-plugin-vue-inspector. Not sure if that's related, but.
|
This comment was marked as resolved.
This comment was marked as resolved.
I tried to update as suggested but I get this error $ npm i
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: visibility@undefined
npm ERR! Found: @nuxt/test-utils@3.8.1
npm ERR! node_modules/@nuxt/test-utils
npm ERR! dev @nuxt/test-utils@"^3.9.0-alpha.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! dev @nuxt/test-utils@"^3.9.0-alpha.1" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: vitest@1.0.4
npm ERR! node_modules/vitest
npm ERR! peer vitest@"^1.0.0" from @vitest/ui@1.0.4
npm ERR! node_modules/@vitest/ui
npm ERR! peerOptional @vitest/ui@"^0.33.0 || ^0.34.6 || ^1.0.0" from @nuxt/test-utils@3.9.0-alpha.1
npm ERR! node_modules/@nuxt/test-utils
npm ERR! dev @nuxt/test-utils@"^3.9.0-alpha.1" from the root project
npm ERR! peerOptional @vitest/ui@"^1.0.0" from vitest@1.0.4
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution. package.json (relevant packages only) "devDependencies": {
"@nuxt/test-utils": "^3.9.0-alpha.1",
"nuxt": "3.7.4",
"vitest": "^1.0.4",
"vitest-environment-nuxt": "^1.0.0-alpha.1",
} vitest.config.mjs import { defineVitestConfig } from '@nuxt/test-utils/config'
export default defineVitestConfig({
test: {
globals: true,
environment: 'nuxt',
server: {
deps: {
inline: ['vuetify'],
},
},
},
}) And nuxt.config.ts modules: [
'@nuxt/test-utils/module', What am I missing? (I tried to remove the node_modules folder to reinstall but it doesn't seem to help) |
@muffincode It looks like vitest wants |
This is now released, with a migration guide in https://github.com/nuxt/test-utils/releases/tag/v3.9.0. Many thanks for all your help testing this ❤️ Please do continue to raise issues! 🙏 |
If you previously used
nuxt-vitest
, we have now merged it into@nuxt/test-utils
, as well as implementing a range of fixes. Here are the required steps:Uninstall
nuxt-vitest
, update yourvitest
versions to v1, and update@nuxt/test-utils
andvitest-environment-nuxt
to the alpha versions:Update your
nuxt.config
if you have added thenuxt-vitest
module to it:Update any imports from
nuxt-vitest
andvitest-environment-nuxt
:Ensure vitest is running in a module context (either by checking you have
type: 'module'
set in yourpackage.json
, or by renaming yourvitest.config
file tovitest.config.mts
orvitest.config.mjs
.If you encounter any problems with this upgrade path, please let us know by raising an issue. 🙏
📖 You can read more in this draft documentation: nuxt/nuxt#24658.
The text was updated successfully, but these errors were encountered: