Description
Environment
- Operating System:
Darwin
- Node Version:
v22.12.0
- Nuxt Version:
3.17.3
- CLI Version:
3.25.1
- Nitro Version:
2.11.12
- Package Manager:
bun@1.2.14
- Builder:
-
- User Config:
modules
,typescript
,alias
,compatibilityDate
,css
,devtools
,experimental
,future
,rootDir
,vite
,hanko
,i18n
- Runtime Modules:
~~/modules/startup-check
,@nuxt/fonts@0.11.4
,@nuxt/icon@1.13.0
,@nuxt/image@1.10.0
,@nuxt/test-utils@3.19.0
,@nuxt/test-utils/module@3.19.0
,@nuxt/ui@3.1.2
,@nuxtjs/i18n@9.5.4
,@nuxtjs/hanko@1.0.0
- Build Modules:
-
Reproduction
https://stackblitz.com/edit/github-d5xpujkj?file=test%2Fbug.test.ts
Describe the bug
I got some trouble when I updated from 3.18 to 3.19
After the update only .nuxt.test.ts
tests are run by vitest.
To restore the previous behaviour (also running tests unrelated to nuxt), I now need to set environment "nuxt", which feels really unintiutive.
export default defineVitestConfig({
test: {
environment: "nuxt",
},
})
Additional context
No response
Activity
danielroe commentedon May 17, 2025
this is not intended and is likely due to the move from environmentMatchGlobs to workspace...
tobiashm commentedon May 19, 2025
julschne commentedon May 22, 2025
danielroe commentedon May 22, 2025
It's not a breaking change; it's a bug.
karladler commentedon May 30, 2025
IMHO this is breaking the functionality of the module that it should either be a major version or the version needs to be rolled back.
.nuxt.
extension #1311lutejka commentedon Jun 2, 2025
Hey @danielroe I also think this is caused by moving to workspaces. My PR gets it working again for most cases, however I needed to import
import { defineNuxtConfig } from 'nuxt/config'
innuxt.config.ts
of the vitest-full example.Not sure why tho
th1nkgr33n commentedon Jun 5, 2025
Until the Fix is applied to the next version, a workaround would be to adapt the vitest.config files
lutejka commentedon Jun 5, 2025
Yes this should work in most cases. However, I think this will run all tests in the nuxt environment. If you depend on not running in the nuxt env, this might not be enough