\n\n### Workaround\nUsing `defineVitestConfig` and hoisting the configuration up to root works fine. Unfortunately I'd need to run three Vitest tasks and couldn't make use of the `projects` functionality.\n\nFor example:\n\n```\npnpm vitest --config vitest.browser.config.ts\npnpm vitest --config vitest.unit.config.ts\npnpm vitest --config vitest.e2e.config.ts\n# 😔\n```\n\n---\n\nSo, I can't figure out how to get it working. I've tried different combinations, singular projects, and using the deprecated `workspaces` key. The method `defineVitestProject` isn't documented and I've read through the code and I'm not really sure why I'm getting an error.\n\n### Nuxt Info\n\n```\n- Operating System: `Darwin`\n- Node Version: `v22.14.0`\n- Nuxt Version: `3.17.5`\n- CLI Version: `3.25.1`\n- Nitro Version: `2.11.12`\n- Package Manager: `pnpm@10.11.1`\n- Builder: `-`\n- User Config: `compatibilityDate`, `modules`\n- Runtime Modules: `@nuxt/test-utils/module@3.19.1`\n- Build Modules: `-`\n```\n\n### Additional information\n\n- [x] Would you be willing to help implement this feature?\n- [ ] Could this feature be implemented as a module?\n\n### Final checks\n\n- [x] Read the [contribution guide](https://nuxt.com/docs/community/contribution).\n- [x] Check existing [discussions](https://github.com/nuxt/nuxt/discussions) and [issues](https://github.com/nuxt/nuxt/issues).",[3134],{"name":3135,"color":3136},"pending triage","5D08F5",1322,"nuxt","test-utils","open","Support Vitest `projects` option for Browser Mode","2025-06-18T13:51:03Z","https://github.com/nuxt/test-utils/issues/1322",0.6437415,{"description":3146,"labels":3147,"number":3149,"owner":3138,"repository":3139,"state":3140,"title":3150,"updated_at":3151,"url":3152,"score":3153},"### Environment\n\n\n\"@nuxt/test-utils\": \"^3.19.2\",\n\"vitest\": \"^3.2.3\"\n\n--\n- Operating System: Windows_NT\n- Node Version: v22.16.0\n- Nuxt Version: 3.17.6\n- CLI Version: 3.25.1\n- Nitro Version: 2.11.13\n- Package Manager: npm@10.9.2\n- Builder: -\n- User Config: runtimeConfig, ssr, alias, compatibilityDate, devtools, css, vite, modules\n- Runtime Modules: @nuxt/test-utils/module@3.19.2, @pinia/nuxt@0.11.1\n- Build Modules: -\n\n### Reproduction\n\nSimilar to [here](https://stackoverflow.com/questions/79537445/not-all-components-impacted-by-coverage).\nIst about the nuxt environment.\nI changed it from `happy-dom` to `nuxt`. Since then it is not coverging pages.\nThe Stackoverflow user had a much simpler set up without projects.\n\n```ts\nimport {\n defineVitestConfig,\n defineVitestProject,\n} from \"@nuxt/test-utils/config\";\nimport vue from \"@vitejs/plugin-vue\";\nimport AutoImport from \"unplugin-auto-import/vite\";\nimport { configDefaults, defineConfig } from \"vitest/config\";\n\n// 1️⃣ Nuxt-specific setup via defineVitestConfig\nconst nuxtConfig = defineVitestConfig({\n test: {\n environment: \"nuxt\",\n globals: true,\n },\n});\n\n// 2️⃣ Full Vitest config using core defineConfig\nexport default defineConfig({\n ...nuxtConfig,\n test: {\n coverage: {\n provider: \"v8\",\n reporter: [\"text\", \"json\", \"html\"],\n reportsDirectory: \"./tests/coverage\",\n exclude: [\n ...(configDefaults.coverage?.exclude ?? []),\n \"**/*.cy.ts\",\n \"**/*.cy.tsx\",\n \"**/cypress/**\",\n \"nuxt.config.ts\",\n \"scripts/**\",\n ],\n thresholds: { statements: 90, branches: 90, functions: 0, lines: 90 },\n },\n\n projects: [\n {\n test: {\n name: \"Server (Node Environment)\",\n include: [\"tests/server/**/*.{test,spec}.ts\"],\n globals: true,\n environment: \"node\",\n },\n plugins: [vue(), AutoImport({ imports: [\"vue\"], dts: true })],\n },\n await defineVitestProject({\n test: {\n name: \"Happy NUXT Environment\",\n include: [\n \"tests/pages/**/*.{test,spec}.ts\",\n \"tests/components/**/*.{test,spec}.ts\",\n \"tests/composables/**/*.{test,spec}.ts\",\n \"tests/utils/**/*.{test,spec}.ts\",\n \"tests/plugins/**/*.{test,spec}.ts\",\n \"tests/layouts/**/*.{test,spec}.ts\",\n \"tests/directives/**/*.{test,spec}.ts\",\n \"tests/mixins/**/*.{test,spec}.ts\",\n \"tests/app.test.ts\",\n \"Tests/error.test.ts\",\n ],\n exclude: [\"tests/server/*.{test,spec}.ts\"],\n globals: true,\n environment: \"nuxt\",\n setupFiles: [\"./tests/setup.ts\"],\n },\n }),\n ],\n },\n});\n```\n\n### Describe the bug\n\nnuxt environment doesn't create coverage for pages\n\n\n\n\n### Additional context\n\nI tried additionally and explicitly adding pages to includes. But it doesn't work.\nPlease, tag me, if it requires to be opened up in a different repository, such as vitest.\n\n### Logs\n\n```shell-script\n\n```",[3148],{"name":3135,"color":3136},1352,"pages are not covered in nuxt environment","2025-07-07T13:56:40Z","https://github.com/nuxt/test-utils/issues/1352",0.6446176,{"description":3155,"labels":3156,"number":3158,"owner":3138,"repository":3139,"state":3140,"title":3159,"updated_at":3160,"url":3161,"score":3162},"### Environment\n\n------------------------------\n- Operating System: Linux\n- Node Version: v20.19.1\n- Nuxt Version: 4.1.1\n- CLI Version: 3.28.0\n- Nitro Version: 2.12.5\n- Package Manager: pnpm@8.15.6\n- Builder: -\n- User Config: compatibilityDate, devtools, modules, typescript\n- Runtime Modules: @nuxt/test-utils/module@3.19.2\n- Build Modules: -\n------------------------------\n\n### Reproduction\n\nhttps://stackblitz.com/edit/nuxt-starter-yt6qbe2t\n\n### Describe the bug\n\nIn the setup instructions from https://nuxt.com/docs/4.x/getting-started/testing#setup, tsconfig aliases are no longer resolved as Vitest does not resolve tsconfig paths by default. In the reproduction, simply running `pnpm nuxt test` will result in the error `Error: Cannot find module '~/utils/add'`.\n\nThe older `defineVitestConfig` added the necessary Nuxt alias resolutions by default, as does the new `defineVitestProject`, but the recommended project config for non-`nuxt` environment tests does not have the necessary resolutions for aliases to work. This complicates the process for users migrating from `defineVitestConfig` to `defineVitestProject`, and results in unintuitive errors for new users who prefer/use aliases over relative paths (e.g. for readability reasons).\n\nSome possible solutions to this issue:\n1. Document the need to copy relevant tsconfig paths from the generated Nuxt tsconfig to `vitest.config.ts`\na. I would recommend against this solution as it is repeating information that is already stored somewhere else, and doubles the work of setting up extra tsconfig aliases if people need it in their tests\n2. Recommend that people add `vite-tsconfig-paths` to their setup to get access to their tsconfig paths in their tests\n3. Provide a way for users to generate Vitest projects with the necessary resolutions in projects where the environment is not `nuxt`, e.g. extending `defineVitestProject` to handle non-`nuxt` environments\n\n### Additional context\n\n_No response_\n\n### Logs\n\n```shell-script\n\n```",[3157],{"name":3135,"color":3136},1408,"tsconfig paths not resolved with documented setup instructions","2025-09-07T17:24:24Z","https://github.com/nuxt/test-utils/issues/1408",0.66549116,{"description":3164,"labels":3165,"number":3169,"owner":3138,"repository":3139,"state":3170,"title":3171,"updated_at":3172,"url":3173,"score":3174},"If I do not include a `nuxt.condfig.ts` in my root and configure vitest like so:\r\n```\r\nimport { fileURLToPath } from 'node:url'\r\nimport { defineVitestConfig } from 'nuxt-vitest/config'\r\n\r\nexport default defineVitestConfig({\r\n test: {\r\n coverage: {\r\n reportsDirectory: '../coverage',\r\n provider: 'c8',\r\n include: ['src/**'],\r\n exclude: ['src/**/*.spec.ts', 'src/**/*.test.ts', 'src/**/*.d.ts'],\r\n all: true\r\n },\r\n environmentOptions: {\r\n nuxt: {\r\n rootDir: fileURLToPath(new URL('./playground', import.meta.url))\r\n }\r\n },\r\n resolveSnapshotPath (path: string, extension: string) {\r\n return path + extension\r\n },\r\n setupFiles: ['./setup.ts']\r\n }\r\n})\r\n```\r\n\r\nI get\r\n```\r\nError: Failed to load nuxt-vitest module. You may need to add it to your nuxt.config.\r\n```\r\n\r\nWhere there is a nuxt config in my module's playground which includes `nuxt-vitest`",[3166],{"name":3167,"color":3168},"vitest-environment","b60205",574,"closed","allow configuring nuxt rootDir and overrides does not appear to work","2023-12-02T00:27:09Z","https://github.com/nuxt/test-utils/issues/574",0.45953694,{"description":3176,"labels":3177,"number":3183,"owner":3138,"repository":3138,"state":3170,"title":3184,"updated_at":3185,"url":3186,"score":3187},"### Environment\n\n- Operating System: Darwin\r\n- Node Version: v18.20.1\r\n- Nuxt Version: 3.6.5\r\n- Nitro Version: 2.5.2\r\n- Package Manager: yarn@4.1.0\r\n- Builder: vite\r\n- User Config: srcDir, buildDir, modules, ssr, nitro, serverHandlers, css, components, imports, build, builder, typescript, vue, hooks\r\n- Runtime Modules: @nuxt/test-utils/module@3.12.0\r\n- Build Modules: -\n\n### Reproduction\n\nUnfortunately I could not reproduce this behaviour in a fresh repo.\n\n### Describe the bug\n\nUsing `defineVitestConfig` from `@nuxt/test-utils` gives me some errors on random(?) test files located in a specific folder (`./src/plugins/` in this case). It seems that vitest doesn't find those tests inside this directory (`No test suite found in file /omniweb/gsd/src/plugins/frontend-commons.spec.ts`). I tried to place a simple `test.spec.ts` inside with a basic test but it doesn't pick that up either.\r\nHowever if I move those test files to another directory at the same level it runs those test. If I rename the folder to `plugins` it again does not run those test files...\r\n\r\nI really can't imagine what's going on here. Are there some forbidden path patterns for some reason?\n\n### Additional context\n\n_No response_\n\n### Logs\n\n_No response_",[3178,3181],{"name":3179,"color":3180},"3.x","29bc7f",{"name":3135,"color":3182},"E99695",26898,"`defineVitestConfig` from `@nuxt/test-utils` is not a drop-in replacement for `defineConfig` from `vite` (`No test suite found in file`)","2024-04-23T07:13:27Z","https://github.com/nuxt/nuxt/issues/26898",0.61502963,{"description":3189,"labels":3190,"number":3196,"owner":3138,"repository":3139,"state":3170,"title":3197,"updated_at":3198,"url":3199,"score":3200},"### Environment\n\nReproduction: https://stackblitz.com/edit/github-gu1sj1?file=tests%2Fbasic.e2e.test.ts\r\n\r\nI can't seem to utilize the alternative nuxt.config location with @nuxt/test-utils. If I have my nuxt.config as `./.config/nuxt.ts`, e2e tests will always fail with `Error: Invalid nuxt app. (Please explicitly set 'options.rootDir' pointing to a valid nuxt app)`.\r\n\r\nThis is my test:\r\n```js\r\n// ./tests/basic.e2e.test.ts\r\nimport { $fetch, setup } from '@nuxt/test-utils/e2e';\r\nimport { describe, expect, it } from 'vitest';\r\n\r\ndescribe('basic', async () => {\r\n await setup({\r\n rootDir: './app',\r\n configFile: '/.config/nuxt.ts',\r\n });\r\n\r\n it('contains Welcome to Nuxt! string', async () => {\r\n const html = await $fetch('/');\r\n expect(html).toContain('Welcome to Nuxt!');\r\n });\r\n});\r\n```\r\nand my nuxt.config:\r\n```js\r\n// ./.config/nuxt.ts\r\nexport default defineNuxtConfig({\r\n compatibilityDate: '2024-04-03',\r\n devtools: { enabled: true },\r\n future: {\r\n compatibilityVersion: 4,\r\n },\r\n modules: ['@nuxt/test-utils/module'],\r\n});\r\n```\r\nIf I move and rename nuxt.config back to the root, it works.\r\n\r\nI'm not sure if this is a limitation or expectation of test-utils of the config file name/location that isn't being honored by the `configFile` setting, or what.\n\n### Reproduction\n\nhttps://stackblitz.com/edit/github-gu1sj1?file=tests%2Fbasic.e2e.test.ts\n\n### Describe the bug\n\nUsing alternative nuxt.config name/location causes e2e tests to fail.\n\n### Additional context\n\n_No response_\n\n### Logs\n\n_No response_",[3191,3194,3195],{"name":3192,"color":3193},"bug","d73a4a",{"name":3167,"color":3168},{"name":3135,"color":3136},893,"e2e tests fail with `.config/nuxt.ts`","2025-08-11T12:15:52Z","https://github.com/nuxt/test-utils/issues/893",0.63557553,{"description":3202,"labels":3203,"number":3206,"owner":3138,"repository":3138,"state":3170,"title":3207,"updated_at":3208,"url":3209,"score":3210},"### Environment\r\n\r\n- Operating System: `Linux`\r\n- Node Version: `v18.9.0`\r\n- Nuxt Version: `3.0.0-rc.11`\r\n- Nitro Version: `0.5.4`\r\n- Package Manager: `npm@8.19.1`\r\n- Builder: `vite`\r\n- User Config: `build`, `css`, `modules`, `runtimeConfig`\r\n- Runtime Modules: `@nuxt/image-edge@1.0.0-27716498.4c23770`\r\n- Build Modules: `-`\r\n\r\n### Reproduction\r\n\r\nApologies, cannot provide due to work policies at my organization.\r\n\r\n### Describe the bug\r\n\r\nBasically I cannot find any way to install the Nuxt plugins I've used in my project while setting up the Vitest config for testing.\r\nI've tried to include the paths to my plugins in setupFiles in vitest.config.ts but doing that gave me an error like - Package import specifier \"#build/app.config.mjs\" is not defined in package. Currently this is my config - \r\n\r\n```\r\n// vitest.config.ts\r\n\r\nimport Vue from '@vitejs/plugin-vue';\r\nimport { resolve } from 'path';\r\nimport fs from 'fs'\r\nimport { defineConfig } from 'vitest/config';\r\nimport AutoImport from 'unplugin-auto-import/vite'\r\n\r\nconst NuxtTsConfig = (fs.readFileSync('./.nuxt/tsconfig.json')).toString()\r\nconst tsConfigFormated = JSON.parse(NuxtTsConfig\r\n .replace(/\\\\\"|\"(?:\\\\\"|[^\"])*\"|(\\/\\/.*|\\/\\*[\\s\\S]*?\\*\\/)/g, (m, g) => g ? '' : m))\r\n\r\nconst r = (p: string) => resolve(__dirname, p)\r\n\r\nexport const alias: Record\u003Cstring, string> = {}\r\n\r\nObject.entries(tsConfigFormated.compilerOptions.paths)\r\n .forEach(([key, value]) => {\r\n alias[key] = r(value[0])\r\n })\r\n\r\nexport default defineConfig({\r\n root: '.',\r\n esbuild: {\r\n tsconfigRaw: '{}',\r\n },\r\n plugins: [\r\n Vue(),\r\n AutoImport({\r\n imports: [\r\n 'vue'\r\n ],\r\n dirs: [\r\n './composables',\r\n './components'\r\n ],\r\n dts: true\r\n })\r\n ],\r\n test: {\r\n globals: true,\r\n environment: 'jsdom',\r\n deps: {\r\n inline: [/@nuxt\\/test-utils-edge/],\r\n },\r\n setupFiles: ['./plugins/some-plugin.ts']\r\n },\r\n resolve: {\r\n alias: {\r\n ...alias,\r\n '#imports': r('./.nuxt/imports.d.ts')\r\n }\r\n }\r\n})\r\n```\r\nAnd this is one of the sample tests I tried to ran -\r\n\r\n```\r\n// login.test.ts\r\n\r\nimport { render, screen } from \"@testing-library/vue\";\r\nimport Login from '../pages/login/index.vue'\r\n\r\ndescribe('Login', async () => {\r\n const text = 'Test'\r\n it('should be span element', async () => {\r\n render(Login)\r\n const elem = await screen.findByText(text)\r\n console.log(elem)\r\n expect(elem.nodeName).toBe('SPAN')\r\n })\r\n})\r\n```\r\n@danielroe @pi0 \r\n\r\nThanks\r\n\r\n### Additional context\r\n\r\n_No response_\r\n\r\n### Logs\r\n\r\n_No response_",[3204,3205],{"name":3179,"color":3180},{"name":3135,"color":3182},15004,"No way to install plugins with Vitest in Nuxt 3","2023-12-02T00:33:54Z","https://github.com/nuxt/nuxt/issues/15004",0.6371025,{"description":3212,"labels":3213,"number":3215,"owner":3138,"repository":3139,"state":3170,"title":3216,"updated_at":3217,"url":3218,"score":3219},"### Environment\n\n- Operating System: `Linux`\n- Node Version: `v22.14.0`\n- Nuxt Version: `4.0.2`\n- CLI Version: `3.27.0`\n- Nitro Version: `2.12.4`\n- Package Manager: `yarn@1.22.22`\n- Builder: `-`\n- User Config: `-`\n- Runtime Modules: `-`\n- Build Modules: `-`\n\n\n### Reproduction\n\nhttps://stackblitz.com/edit/github-rh3mlpir\n\n### Describe the bug\n\nSince I updated my module's nuxt version to `4.0.2` I can't run my tests anymore.\nLocally I get this error\n```\n➜ shared git:(dependabot/npm_and_yarn/nuxt-4.0.2) yarn test\nyarn run v1.22.22\n$ vitest run\nfailed to load config from /home/joenn/code/leexi/shared/vitest.config.ts\n\n⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Startup Error ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯\nAggregateError: Failed to initialize projects. There were errors during projects setup. See below for more details.\n at resolveProjects (file:///home/joenn/code/leexi/shared/node_modules/vitest/dist/chunks/cli-api.BkDphVBG.js:7486:27)\n at async Vitest._setServer (file:///home/joenn/code/leexi/shared/node_modules/vitest/dist/chunks/cli-api.BkDphVBG.js:9319:20)\n at async BasicMinimalPluginContext.handler (file:///home/joenn/code/leexi/shared/node_modules/vitest/dist/chunks/cli-api.BkDphVBG.js:10169:6)\n at async _createServer (file:///home/joenn/code/leexi/shared/node_modules/vite/dist/node/chunks/dep-BHkUv4Z8.js:28570:86)\n at async createViteServer (file:///home/joenn/code/leexi/shared/node_modules/vitest/dist/chunks/cli-api.BkDphVBG.js:6911:17)\n at async createVitest (file:///home/joenn/code/leexi/shared/node_modules/vitest/dist/chunks/cli-api.BkDphVBG.js:10202:17)\n at async prepareVitest (file:///home/joenn/code/leexi/shared/node_modules/vitest/dist/chunks/cli-api.BkDphVBG.js:10541:14)\n at async startVitest (file:///home/joenn/code/leexi/shared/node_modules/vitest/dist/chunks/cli-api.BkDphVBG.js:10488:14)\n at async start (file:///home/joenn/code/leexi/shared/node_modules/vitest/dist/chunks/cac.Cb-PYCCB.js:1412:15)\n at async CAC.run (file:///home/joenn/code/leexi/shared/node_modules/vitest/dist/chunks/cac.Cb-PYCCB.js:1391:2) {\n [errors]: [\n Error: Nuxt instance is unavailable!\n at useNuxt (file:///home/joenn/code/leexi/shared/node_modules/@nuxt/vite-builder/node_modules/@nuxt/kit/dist/index.mjs:43:11)\n at useNitro (file:///home/joenn/code/leexi/shared/node_modules/@nuxt/vite-builder/node_modules/@nuxt/kit/dist/index.mjs:795:16)\n at useResolveFromPublicAssets (file:///home/joenn/code/leexi/shared/node_modules/@nuxt/vite-builder/dist/index.mjs:666:17)\n at PublicDirsPlugin (file:///home/joenn/code/leexi/shared/node_modules/@nuxt/vite-builder/dist/index.mjs:573:39)\n at bundle (file:///home/joenn/code/leexi/shared/node_modules/@nuxt/vite-builder/dist/index.mjs:1662:11)\n at async bundle (file:///home/joenn/code/leexi/shared/node_modules/nuxt/dist/index.mjs:7275:5)\n at async build (file:///home/joenn/code/leexi/shared/node_modules/nuxt/dist/index.mjs:7135:3)\n ]\n}\n\n\n\nerror Command failed with exit code 1.\ninfo Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.\n```\n\n---\n\nIn the reproduction a similar error can be found when running `yarn test`\n```\n~/projects/bnmijrqrzb.github 13s\n❯ yarn test\nyarn run v1.22.19\n$ vitest run\n(node:399) ExperimentalWarning: WASI is an experimental feature and might change at any time\n(Use `node --trace-warnings ...` to show where the warning was created)\nfailed to load config from /home/projects/bnmijrqrzb.github/vitest.config.ts\n[warn] Overriding NuxtWelcome component. You can specify a `priority` option when calling `addComponent` to avoid this warning.\n[warn] Overriding NuxtLayout component. You can specify a `priority` option when calling `addComponent` to avoid this warning.\n[warn] Overriding NuxtErrorBoundary component. You can specify a `priority` option when calling `addComponent` to avoid this warning.\n[warn] Overriding ClientOnly component. You can specify a `priority` option when calling `addComponent` to avoid this warning.\n[warn] Overriding DevOnly component. You can specify a `priority` option when calling `addComponent` to avoid this warning.\n[warn] Overriding ServerPlaceholder component. You can specify a `priority` option when calling `addComponent` to avoid this warning.\n[warn] Overriding NuxtLink component. You can specify a `priority` option when calling `addComponent` to avoid this warning.\n[warn] Overriding NuxtLoadingIndicator component. You can specify a `priority` option when calling `addComponent` to avoid this warning.\n[warn] Overriding NuxtTime component. You can specify a `priority` option when calling `addComponent` to avoid this warning.\n[warn] Overriding NuxtRouteAnnouncer component. You can specify a `priority` option when calling `addComponent` to avoid this warning.\n[warn] Overriding NuxtImg component. You can specify a `priority` option when calling `addComponent` to avoid this warning.\n[warn] Overriding NuxtPicture component. You can specify a `priority` option when calling `addComponent` to avoid this warning.\n[warn] Overriding NuxtIsland component. You can specify a `priority` option when calling `addComponent` to avoid this warning.\n\n⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Startup Error ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯\nAggregateError: Failed to initialize projects. There were errors during projects setup. See below for more details.\n at resolveProjects (file:///home/projects/bnmijrqrzb.github/node_modules/vitest/dist/chunks/cli-api.BkDphVBG.js:7515:27)\n at async Vitest._setServer (file:///home/projects/bnmijrqrzb.github/node_modules/vitest/dist/chunks/cli-api.BkDphVBG.js:9348:20)\n at async BasicMinimalPluginContext.handler (file:///home/projects/bnmijrqrzb.github/node_modules/vitest/dist/chunks/cli-api.BkDphVBG.js:10198:6)\n at async _createServer (file:///home/projects/bnmijrqrzb.github/node_modules/vite/dist/node/chunks/dep-BHkUv4Z8.js:28667:86)\n at async createViteServer (file:///home/projects/bnmijrqrzb.github/node_modules/vitest/dist/chunks/cli-api.BkDphVBG.js:6940:17)\n at async createVitest (file:///home/projects/bnmijrqrzb.github/node_modules/vitest/dist/chunks/cli-api.BkDphVBG.js:10231:17)\n at async prepareVitest (file:///home/projects/bnmijrqrzb.github/node_modules/vitest/dist/chunks/cli-api.BkDphVBG.js:10570:14)\n at async startVitest (file:///home/projects/bnmijrqrzb.github/node_modules/vitest/dist/chunks/cli-api.BkDphVBG.js:10517:14)\n at async start (file:///home/projects/bnmijrqrzb.github/node_modules/vitest/dist/chunks/cac.Cb-PYCCB.js:1429:15)\n at async CAC.run (file:///home/projects/bnmijrqrzb.github/node_modules/vitest/dist/chunks/cac.Cb-PYCCB.js:1408:2) {\n [errors]: [\n Error: Nitro is not initialized yet. You can call `useNitro()` only after `ready` hook.\n at Module.useNitro (file:///home/projects/bnmijrqrzb.github/node_modules/@nuxt/kit/dist/index.mjs:890:11)\n at initNuxt (file:///home/projects/bnmijrqrzb.github/node_modules/nuxt/dist/index.mjs:5772:27)\n at async loadNuxt (file:///home/projects/bnmijrqrzb.github/node_modules/nuxt/dist/index.mjs:5864:5)\n at async Module.loadNuxt (file:///home/projects/bnmijrqrzb.github/node_modules/@nuxt/test-utils/node_modules/@nuxt/kit/dist/index.mjs:2822:19)\n at async startNuxtAndGetViteConfig (file:///home/projects/bnmijrqrzb.github/node_modules/@nuxt/test-utils/dist/config.mjs:57:16)\n at async getVitestConfigFromNuxt (file:///home/projects/bnmijrqrzb.github/node_modules/@nuxt/test-utils/dist/config.mjs:111:15)\n at async resolveConfig (file:///home/projects/bnmijrqrzb.github/node_modules/@nuxt/test-utils/dist/config.mjs:297:5)\n at async eval (file:///home/projects/bnmijrqrzb.github/node_modules/@nuxt/test-utils/dist/config.mjs:242:28)\n at async loadConfigFromFile (file:///home/projects/bnmijrqrzb.github/node_modules/vite/dist/node/chunks/dep-BHkUv4Z8.js:36439:20)\n at async resolveConfig (file:///home/projects/bnmijrqrzb.github/node_modules/vite/dist/node/chunks/dep-BHkUv4Z8.js:36093:22)\n ]\n}\n\n\n\nerror Command failed with exit code 1.\ninfo Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.\n```\n\n---\n\nDeleting the `vitest.config.ts` file resolves the issue but I want to define a custom config file to add aliases to vitest as well as configure some of the test options\n```ts\nimport path from 'path';\nimport { defineVitestConfig } from '@nuxt/test-utils/config';\n\nexport default defineVitestConfig({\n resolve: {\n alias: {\n '~': path.resolve(__dirname),\n },\n },\n test: {\n environment: 'happy-dom',\n globals: true,\n reporters: 'verbose',\n },\n});\n```\n",[3214],{"name":3135,"color":3136},1375,"Can't define custom vitest.config file anymore since Nuxt 4","2025-08-05T11:21:42Z","https://github.com/nuxt/test-utils/issues/1375",0.6392874,{"description":3221,"labels":3222,"number":3230,"owner":3138,"repository":3138,"state":3170,"title":3231,"updated_at":3232,"url":3233,"score":3234},"### Environment\n\nRootDir: /Users/dev02/dev/temporario/app-nuxt-3\r\n------------------------------\r\n- Operating System: `Darwin`\r\n- Node Version: `v16.14.2`\r\n- Nuxt Version: `3.0.0`\r\n- Nitro Version: `1.0.0`\r\n- Package Manager: `yarn@1.22.10`\r\n- Builder: `vite`\r\n- User Config: `ssr`, `app`, `css`, `windicss`, `build`, `modules`, `experimental`, `components`, `vite`, `runtimeConfig`, `intlify`, `vueuse`, `content`\r\n- Runtime Modules: `@intlify/nuxt3@0.2.4`, `@pinia/nuxt@0.4.6`, `@nuxt/content@2.2.2`, `@vueuse/nuxt@9.6.0`, `nuxt-windicss@2.5.5`, `nuxt-icon@0.1.8`\r\n- Build Modules: `-`\r\n------------------------------\n\n### Reproduction\n\n// app-nuxt-3/test/hoje.test.js\r\n\r\nimport { fileURLToPath } from 'node:url'\r\nimport { describe, expect, it } from 'vitest'\r\nimport { isWindows } from 'std-env'\r\nimport { setup, fetch, $fetch, startServer, createPage, url } from '@nuxt/test-utils'\r\n\r\nawait setup({\r\n rootDir: fileURLToPath(new URL('../../app-nuxt-3', import.meta.url)),\r\n server: true,\r\n browser: false,\r\n setupTimeout: (isWindows ? 240 : 120) * 1000\r\n})\r\n\r\ndescribe('pages', () => {\r\n it('render index', async () => {\r\n const html = await $fetch('/')\r\n expect(html).toContain('Fundação de Esportes DEV')\r\n })\r\n\r\n\r\n\n\n### Describe the bug\n\nHere are the links to the documentation and the example I took to make mine.\r\nhttps://nuxt.com/docs/getting-started/testing\r\nhttps://github.com/nuxt/framework/tree/main/test\r\n\r\nThe issue I'm having is the app is telling me the Url must be from the schema file. I'm in doubt if the Url is wrong when pointing to the application or if the scheme he wants to say is something else. I can't find any examples on the internet that help me.\r\nNote: Remembering that I configured Vitest and use it normally, including together with Pinia. The real problem is when I started testing the Nuxt components themselves. I haven't even started yet.\r\n\r\nError picture:\r\n\r\n\u003Cimg width=\"643\" alt=\"Captura de Tela 2023-01-09 às 10 42 12\" src=\"https://user-images.githubusercontent.com/83841469/211322216-b68c08fa-1f02-4793-9a03-bd8e275439c1.png\">\r\n\n\n### Additional context\n\nIt's my first time writing a bug (I've always been able to solve it by searching), so forgive me if it's not good enough.\n\n### Logs\n\n_No response_",[3223,3224,3227],{"name":3179,"color":3180},{"name":3225,"color":3226},"needs reproduction","FBCA04",{"name":3228,"color":3229},"⛔️ can be closed","484893",12368,"Problem starting @nuxt/test-utils with URL","2023-02-07T07:10:45Z","https://github.com/nuxt/nuxt/issues/12368",0.6398852,{"description":3236,"labels":3237,"number":3239,"owner":3138,"repository":3139,"state":3170,"title":3240,"updated_at":3241,"url":3242,"score":3243},"### Environment\r\n\r\n- Operating System: `Linux`\r\n- Node Version: `v16.14.2`\r\n- Nuxt Version: `3.0.0-rc.8`\r\n- Package Manager: `npm@7.17.0`\r\n- Builder: `vite`\r\n- User Config: `modules`\r\n- Runtime Modules: `vite-plugin-vue-type-imports/nuxt`\r\n- Build Modules: `-`\r\n\r\n### Reproduction\r\n\r\n#### How to recreate\r\n\r\nFor every link:\r\n\r\n1. Open a link.\r\n2. Wait for a development server is start and the Nuxt Welcome page is loaded.\r\n4. Press \u003Ckbd>Ctrl\u003C/kbd> + \u003Ckbd>C\u003C/kbd> in Terminal.\r\n5. Run `npm test`.\r\n\r\n#### Broken\r\n\r\nhttps://stackblitz.com/edit/github-owtwqh-82agcd?file=nuxt.config.ts,modules%2Fvite-plugin-vue-type-imports.ts,app.vue\r\n\r\n##### Load a bundled Nuxt module from the `node_modules` directory\r\n\r\n```ts\r\nexport default defineNuxtConfig({\r\n modules: [\r\n 'vite-plugin-vue-type-imports/nuxt',\r\n ],\r\n});\r\n```\r\n\r\n#### Working\r\n\r\nhttps://stackblitz.com/edit/github-owtwqh-dyj8f8?file=nuxt.config.ts,modules%2Fvite-plugin-vue-type-imports.ts,app.vue\r\n\r\n##### Load a local Nuxt module from the `modules/` directory\r\n\r\n```ts\r\nexport default defineNuxtConfig({\r\n modules: [\r\n '~/modules/vite-plugin-vue-type-imports.ts',\r\n ],\r\n});\r\n```\r\n\r\n### Describe the bug\r\n\r\nThe `vite-plugin-vue-type-imports/nuxt` module added in `nuxt.config.ts` is:\r\n\r\n* works when loaded via `npm run dev`;\r\n* broken if loaded via `npm test` (`nuxt test` or `vitest` with `@nuxt/test-utils-edge`).\r\n\r\n### Additional context\r\n\r\nThe [same Nuxt module code](https://github.com/wheatjs/vite-plugin-vue-type-imports/blob/370fcea9c7a09a0961bdf6e29b0795963034eb1e/src/nuxt.ts) is works with `npm test` if copy-pasted and loaded as a local plugin from the `modules/` directory.\r\n\r\n### Logs\r\n\r\n```shell\r\nERROR TypeError: Invalid URL 22:18:50\r\n\r\n ❯ TypeError.get https:/github-owtwqh-82agcd.w.staticblitz.com/blitz.df64f655701fde45529fa8e152b3842072335b47.js:6:292488\r\n 22:18:50\r\n⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯\r\nSerialized Error: { 22:18:50\r\n \"code\": \"ERR_INVALID_URL\",\r\n \"input\": \"//\",\r\n}\r\n```\r\n",[3238],{"name":3192,"color":3193},345,"Vitest with `@nuxt/test-utils-edge` breaks imported `vite-plugin-vue-type-imports/nuxt` module, but works if same module code is recreated locally","2023-12-02T00:33:10Z","https://github.com/nuxt/test-utils/issues/345",0.64240307,["Reactive",3245],{},["Set"],["ShallowReactive",3248],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$f_LJDWAauZka5TCuTb0SnJ-_D39fD_6x5PSUPrvrx06Y":-1},"/nuxt/fonts/574"]